From: Martin v. Löwis Date: Mon, 16 Sep 2002 17:26:24 +0000 (+0000) Subject: Make BadPickleGet a class. Fixes #609164. X-Git-Tag: v2.3c1~4058 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=658009afdb429a9507852c72086337c42bcf1532;p=thirdparty%2FPython%2Fcpython.git Make BadPickleGet a class. Fixes #609164. --- diff --git a/Misc/NEWS b/Misc/NEWS index e1e0104f0e2d..613c8a73e6b4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -274,6 +274,8 @@ Core and builtins Extension modules +- cPickle.BadPickleGet is now a class. + - The time stamps in os.stat_result are floating point numbers now. - If the size passed to mmap.mmap() is larger than the length of the diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 14936a6805c6..32fdd6ed7686 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -4760,6 +4760,10 @@ init_stuff(PyObject *module_dict) PickleError, NULL))) return -1; + if (!( BadPickleGet = PyErr_NewException("cPickle.BadPickleGet", + UnpicklingError, NULL))) + return -1; + if (PyDict_SetItemString(module_dict, "PickleError", PickleError) < 0) return -1; @@ -4776,9 +4780,6 @@ init_stuff(PyObject *module_dict) UnpickleableError) < 0) return -1; - if (!( BadPickleGet = PyString_FromString("cPickle.BadPickleGet"))) - return -1; - if (PyDict_SetItemString(module_dict, "BadPickleGet", BadPickleGet) < 0) return -1;