summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index e553920..a507595 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -213,6 +213,11 @@ class Pickler:
try:
f = self.dispatch[t]
except KeyError:
+ pid = self.inst_persistent_id(object)
+ if pid is not None:
+ self.save_pers(pid)
+ return
+
try:
issc = issubclass(t, TypeType)
except TypeError: # t is not a class
@@ -221,11 +226,6 @@ class Pickler:
self.save_global(object)
return
- pid = self.inst_persistent_id(object)
- if pid is not None:
- self.save_pers(pid)
- return
-
try:
reduce = dispatch_table[t]
except KeyError: