summaryrefslogtreecommitdiff
path: root/Python/importdl.c
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2013-10-28 21:41:24 +0100
committerNadeem Vawda <nadeem.vawda@gmail.com>2013-10-28 21:41:24 +0100
commitacf010d6b83e6ee4bc916a61b04938f2f4205810 (patch)
tree20104eff0d9561d62fc9f538a7882d7b98e00ac1 /Python/importdl.c
parent284a788ebc97e88858f9299669470438dcf0ebfb (diff)
parentc3408df66ec4dbebcbbfc283cebd9736d97f5f1c (diff)
downloadcpython-acf010d6b83e6ee4bc916a61b04938f2f4205810.tar.gz
#19395: Raise exception when pickling a (BZ2|LZMA)(Compressor|Decompressor).
The underlying C libraries provide no mechanism for serializing compressor and decompressor objects, so actually pickling these classes is impractical. Previously, these objects would be pickled without error, but attempting to use a deserialized instance would segfault the interpreter.
Diffstat (limited to 'Python/importdl.c')
-rw-r--r--Python/importdl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index 0ea954cae0..b60f1c75fb 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -77,6 +77,8 @@ _PyImport_LoadDynamicModule(PyObject *name, PyObject *path, FILE *fp)
PyObject *msg = PyUnicode_FromFormat("dynamic module does not define "
"init function (PyInit_%s)",
shortname);
+ if (msg == NULL)
+ goto error;
PyErr_SetImportError(msg, name, path);
Py_DECREF(msg);
goto error;