summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-11-15 22:14:28 (GMT)
committerGitHub <noreply@github.com>2017-11-15 22:14:28 (GMT)
commit43605e6bfa8d49612df4a38460d063d6ba781906 (patch)
treefb35c0febdb3b6b388b9c4eb6fabec0b7f1f861c /Lib/asyncio
parent4bd41c9b52ea0c730e9e294caaf003e54c088c6e (diff)
downloadcpython-43605e6bfa8d49612df4a38460d063d6ba781906.zip
cpython-43605e6bfa8d49612df4a38460d063d6ba781906.tar.gz
cpython-43605e6bfa8d49612df4a38460d063d6ba781906.tar.bz2
bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable #4409
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 9fda853..30b751e 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, *,