mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable #4409
This commit is contained in:
parent
4bd41c9b52
commit
43605e6bfa
3 changed files with 25 additions and 0 deletions
|
@ -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, *,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue