From abfd8064d8d246450c4506b16085d0378d1778a8 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 8 Aug 1996 20:26:45 +0000 Subject: [PATCH] This is the third time I check in this change :-( Don't use assignments into inst.__dict__ to restore instance variables; use setattr() instead. --- Lib/pickle.py | 3 +-- 1 file changed, 1 insertion(+), 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 -- 2.50.1