From: Guido van Rossum Date: Thu, 8 Aug 1996 20:26:45 +0000 (+0000) Subject: This is the third time I check in this change :-( X-Git-Tag: v1.4b3~177 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abfd8064d8d246450c4506b16085d0378d1778a8;p=thirdparty%2FPython%2Fcpython.git 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 a481fc7fce92..682440d3aeed 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