From: Guido van Rossum Date: Mon, 7 Oct 1996 14:34:20 +0000 (+0000) Subject: Compromise on test in find_class(): a user-defined function is okay, X-Git-Tag: v1.4~146 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36fc11e894510d1521a934f3e77d596e94431c2f;p=thirdparty%2FPython%2Fcpython.git Compromise on test in find_class(): a user-defined function is okay, but a built-in function is not. --- diff --git a/Lib/pickle.py b/Lib/pickle.py index 682440d3aeed..28f8f901d123 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)