mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
56db095018
commit
c84d8bd7be
|
@ -4521,6 +4521,8 @@ initcPickle(void) {
|
||||||
PyObject *format_version;
|
PyObject *format_version;
|
||||||
PyObject *compatible_formats;
|
PyObject *compatible_formats;
|
||||||
|
|
||||||
|
if (init_stuff(m, d) < 0) return;
|
||||||
|
|
||||||
Picklertype.ob_type = &PyType_Type;
|
Picklertype.ob_type = &PyType_Type;
|
||||||
Unpicklertype.ob_type = &PyType_Type;
|
Unpicklertype.ob_type = &PyType_Type;
|
||||||
PdataType.ob_type = &PyType_Type;
|
PdataType.ob_type = &PyType_Type;
|
||||||
|
@ -4542,6 +4544,4 @@ initcPickle(void) {
|
||||||
PyDict_SetItemString(d, "compatible_formats", compatible_formats);
|
PyDict_SetItemString(d, "compatible_formats", compatible_formats);
|
||||||
Py_XDECREF(format_version);
|
Py_XDECREF(format_version);
|
||||||
Py_XDECREF(compatible_formats);
|
Py_XDECREF(compatible_formats);
|
||||||
|
|
||||||
init_stuff(m, d);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue