commit | abfd8064d8d246450c4506b16085d0378d1778a8 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Thu Aug 08 20:26:45 1996 +0000 |
committer | Guido van Rossum <guido@python.org> | Thu Aug 08 20:26:45 1996 +0000 |
tree | 6de8ecdda89aa165eaa7fa483f1686790f222ad5 | |
parent | 99d90c0d0e3716952740eaaa6853be3f6508a7fd [diff] [blame] |
This is the third time I check in this change :-( Don't use assignments into inst.__dict__ to restore instance variables; use setattr() instead.
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 @@ 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