summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2009-04-03 04:17:41 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2009-04-03 04:17:41 (GMT)
commit0e7aa8c13ce9c1add23e45de1fef14d67a5cb9c6 (patch)
tree1e0e0639fb8ab74e8b972bb86c7c6bc5aea2c803 /Modules
parentb646aa178983cb1b290d1f86be149704c8957f02 (diff)
downloadcpython-0e7aa8c13ce9c1add23e45de1fef14d67a5cb9c6.zip
cpython-0e7aa8c13ce9c1add23e45de1fef14d67a5cb9c6.tar.gz
cpython-0e7aa8c13ce9c1add23e45de1fef14d67a5cb9c6.tar.bz2
Update a comment about why the __module__ can sometime be NULL.
Initialize last_string and arg member of Unpickler.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_pickle.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 4976cc5..bda8efd 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -691,9 +691,9 @@ whichmodule(PyObject *global, PyObject *global_name)
module_name = PyObject_GetAttr(global, module_str);
- /* In some rare cases (e.g., random.getrandbits), __module__ can be
- None. If it is so, then search sys.modules for the module of
- global. */
+ /* In some rare cases (e.g., bound methods of extension types),
+ __module__ can be None. If it is so, then search sys.modules
+ for the module of global. */
if (module_name == Py_None) {
Py_DECREF(module_name);
goto search;
@@ -4447,6 +4447,9 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
if (self->memo == NULL)
return -1;
+ self->last_string = NULL;
+ self->arg = NULL;
+
return 0;
}