summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-08-08 20:26:45 (GMT)
committerGuido van Rossum <guido@python.org>1996-08-08 20:26:45 (GMT)
commitabfd8064d8d246450c4506b16085d0378d1778a8 (patch)
tree6de8ecdda89aa165eaa7fa483f1686790f222ad5 /Lib
parent99d90c0d0e3716952740eaaa6853be3f6508a7fd (diff)
downloadcpython-abfd8064d8d246450c4506b16085d0378d1778a8.zip
cpython-abfd8064d8d246450c4506b16085d0378d1778a8.tar.gz
cpython-abfd8064d8d246450c4506b16085d0378d1778a8.tar.bz2
This is the third time I check in this change :-(
Don't use assignments into inst.__dict__ to restore instance variables; use setattr() instead.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pickle.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index a481fc7..682440d 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -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