summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/pickle.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index a481fc7fce..682440d3ae 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