Kaydet (Commit) 3e3583c3 authored tarafından Guido van Rossum's avatar Guido van Rossum

Fix from SF patch 565085: copy._reduction doesn't __setstate__.

Straightforward fix.  Will backport to 2.2.  If there's ever a new 2.1
release, this could be backported there too (since it's an issue with
anything that's got both a __reduce__ and a __setstate__).
üst 88a20baa
......@@ -301,7 +301,10 @@ def _reconstruct(x, info, deep, memo=None):
if state:
if deep:
state = deepcopy(state, memo)
y.__dict__.update(state)
if hasattr(y, '__setstate__'):
y.__setstate__(state)
else:
y.__dict__.update(state)
return y
del d
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment