Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85ee491

Browse files
committed
Fix for SF 502085.
Don't die when issubclass(t, TypeType) fails. Bugfix candidate (but I think it's too late for 2.2.1).
1 parent 7e78acb commit 85ee491

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/pickle.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ def save(self, object, pers_save = 0):
164164
try:
165165
f = self.dispatch[t]
166166
except KeyError:
167-
if issubclass(t, TypeType):
167+
try:
168+
issc = issubclass(t, TypeType)
169+
except TypeError: # t is not a class
170+
issc = 0
171+
if issc:
168172
self.save_global(object)
169173
return
170174

0 commit comments

Comments
 (0)