mirror of
https://github.com/python/cpython.git
synced 2025-12-05 00:52:25 +00:00
This is the third time I check in this change :-(
Don't use assignments into inst.__dict__ to restore instance variables; use setattr() instead.
This commit is contained in:
parent
99d90c0d0e
commit
abfd8064d8
1 changed files with 1 additions and 2 deletions
|
|
@ -522,9 +522,8 @@ class Unpickler:
|
||||||
try:
|
try:
|
||||||
setstate = inst.__setstate__
|
setstate = inst.__setstate__
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
instdict = inst.__dict__
|
|
||||||
for key in value.keys():
|
for key in value.keys():
|
||||||
instdict[key] = value[key]
|
setattr(inst, key, value[key])
|
||||||
else:
|
else:
|
||||||
setstate(value)
|
setstate(value)
|
||||||
dispatch[BUILD] = load_build
|
dispatch[BUILD] = load_build
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue