summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-09-07 00:11:40 (GMT)
committerGuido van Rossum <guido@python.org>2000-09-07 00:11:40 (GMT)
commitc84d8bd7be6ea7ce21973da06e821e01604dda4f (patch)
tree23b4ea1aeca4934a5938ca89e05642ff951d47a9
parent56db09501881ab517079e459aa9777ac1039b767 (diff)
downloadcpython-c84d8bd7be6ea7ce21973da06e821e01604dda4f.zip
cpython-c84d8bd7be6ea7ce21973da06e821e01604dda4f.tar.gz
cpython-c84d8bd7be6ea7ce21973da06e821e01604dda4f.tar.bz2
Simple fix from Jin Fulton to avoid returning a half-initialized
module when e.g. copy_reg.py doesn't exist. This caused a core dump. This closes SF bug 112944.
-rw-r--r--Modules/cPickle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index b64b1f1..7161c2e 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -4521,6 +4521,8 @@ initcPickle(void) {
PyObject *format_version;
PyObject *compatible_formats;
+ if (init_stuff(m, d) < 0) return;
+
Picklertype.ob_type = &PyType_Type;
Unpicklertype.ob_type = &PyType_Type;
PdataType.ob_type = &PyType_Type;
@@ -4542,6 +4544,4 @@ initcPickle(void) {
PyDict_SetItemString(d, "compatible_formats", compatible_formats);
Py_XDECREF(format_version);
Py_XDECREF(compatible_formats);
-
- init_stuff(m, d);
}