Commit 2460c621 authored by Christian Tismer's avatar Christian Tismer

made cPickle fall back to the copy_reg/reduce protocol,

if a function cannot be stored as global.
This is for compatibility with pickle.py .
parent d594849c
......@@ -2418,6 +2418,11 @@ save(Picklerobject *self, PyObject *args, int pers_save)
case 'f':
if (type == &PyFunction_Type) {
res = save_global(self, args, NULL);
if (res && PyErr_ExceptionMatches(PickleError)) {
/* fall back to reduce */
PyErr_Clear();
break;
}
goto finally;
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment