summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-11-16 00:28:25 (GMT)
committerYury Selivanov <yury@magic.io>2017-11-16 00:28:25 (GMT)
commitf35076a002b958f991d180d6f945344cc5ab3900 (patch)
treec0e4e49172999a62fcee5836351db8317d977dc8 /Lib/asyncio
parentd15bb5fcad584e113836486d17c6abcbf2168a86 (diff)
downloadcpython-f35076a002b958f991d180d6f945344cc5ab3900.zip
cpython-f35076a002b958f991d180d6f945344cc5ab3900.tar.gz
cpython-f35076a002b958f991d180d6f945344cc5ab3900.tar.bz2
bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable GH-4409 (#4411)
(cherry picked from commit 43605e6bfa8d49612df4a38460d063d6ba781906)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/streams.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
index a82cc79..4089b0e 100644
--- a/Lib/asyncio/streams.py
+++ b/Lib/asyncio/streams.py
@@ -35,6 +35,9 @@ class IncompleteReadError(EOFError):
self.partial = partial
self.expected = expected
+ def __reduce__(self):
+ return type(self), (self.partial, self.expected)
+
class LimitOverrunError(Exception):
"""Reached the buffer limit while looking for a separator.
@@ -46,6 +49,9 @@ class LimitOverrunError(Exception):
super().__init__(message)
self.consumed = consumed
+ def __reduce__(self):
+ return type(self), (self.args[0], self.consumed)
+
@coroutine
def open_connection(host=None, port=None, *,