From 85ee491b3af3e1c124522249a52443b4d8c34c88 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 26 Mar 2002 00:51:56 +0000 Subject: [PATCH] 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). --- Lib/pickle.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/pickle.py b/Lib/pickle.py index 7e8e6656683..21ea21536fa 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -164,7 +164,11 @@ class Pickler: try: f = self.dispatch[t] except KeyError: - if issubclass(t, TypeType): + try: + issc = issubclass(t, TypeType) + except TypeError: # t is not a class + issc = 0 + if issc: self.save_global(object) return