mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
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__).
This commit is contained in:
parent
88a20baa77
commit
3e3583c345
1 changed files with 4 additions and 1 deletions
|
@ -301,7 +301,10 @@ def _reconstruct(x, info, deep, memo=None):
|
||||||
if state:
|
if state:
|
||||||
if deep:
|
if deep:
|
||||||
state = deepcopy(state, memo)
|
state = deepcopy(state, memo)
|
||||||
y.__dict__.update(state)
|
if hasattr(y, '__setstate__'):
|
||||||
|
y.__setstate__(state)
|
||||||
|
else:
|
||||||
|
y.__dict__.update(state)
|
||||||
return y
|
return y
|
||||||
|
|
||||||
del d
|
del d
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue