From 36fc11e894510d1521a934f3e77d596e94431c2f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 7 Oct 1996 14:34:20 +0000 Subject: Compromise on test in find_class(): a user-defined function is okay, but a built-in function is not. --- Lib/pickle.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Lib/pickle.py b/Lib/pickle.py index 682440d..28f8f90 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -473,9 +473,7 @@ class Unpickler: "Failed to import class %s from module %s" % \ (name, module) klass = env[name] - # if type(klass) != ClassType: - if (type(klass) is FunctionType or - type(klass) is BuiltinFunctionType): + if type(klass) is BuiltinFunctionType: raise SystemError, \ "Imported object %s from module %s is not a class" % \ (name, module) -- cgit v0.12