mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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:
|
||||
setstate = inst.__setstate__
|
||||
except AttributeError:
|
||||
instdict = inst.__dict__
|
||||
for key in value.keys():
|
||||
instdict[key] = value[key]
|
||||
setattr(inst, key, value[key])
|
||||
else:
|
||||
setstate(value)
|
||||
dispatch[BUILD] = load_build
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue