diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-07-16 19:47:43 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-07-16 19:47:43 (GMT) |
commit | 39c6116483bd7932cee220943e329c5994f62cc7 (patch) | |
tree | 4a6185dcf61e2dc5c06386075cfd2802ff8d0e86 /Modules/cPickle.c | |
parent | 719841e2fbf9ca6320aa9515fe054cf4887dab64 (diff) | |
download | cpython-39c6116483bd7932cee220943e329c5994f62cc7.zip cpython-39c6116483bd7932cee220943e329c5994f62cc7.tar.gz cpython-39c6116483bd7932cee220943e329c5994f62cc7.tar.bz2 |
Given the persistent id code a shot at a class before calling save_global().
Some persistent picklers (well, probably, the *only* persistent
pickler) would like to pickle some classes in a special way.
Diffstat (limited to 'Modules/cPickle.c')
-rw-r--r-- | Modules/cPickle.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 91a63bf..ce32683 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -2015,11 +2015,6 @@ save(Picklerobject *self, PyObject *args, int pers_save) } } - if (PyType_IsSubtype(type, &PyType_Type)) { - res = save_global(self, args, NULL); - goto finally; - } - if (!pers_save && self->inst_pers_func) { if ((tmp = save_pers(self, args, self->inst_pers_func)) != 0) { res = tmp; @@ -2027,6 +2022,11 @@ save(Picklerobject *self, PyObject *args, int pers_save) } } + if (PyType_IsSubtype(type, &PyType_Type)) { + res = save_global(self, args, NULL); + goto finally; + } + if ((__reduce__ = PyDict_GetItem(dispatch_table, (PyObject *)type))) { Py_INCREF(__reduce__); |