[Python-checkins] r71084 - python/branches/py3k/Modules/_pickle.c

alexandre.vassalotti python-checkins at python.org
Fri Apr 3 06:17:41 CEST 2009


Author: alexandre.vassalotti
Date: Fri Apr 3 06:17:41 2009
New Revision: 71084
Log:
Update a comment about why the __module__ can sometime be NULL.
Initialize last_string and arg member of Unpickler.
Modified:
 python/branches/py3k/Modules/_pickle.c
Modified: python/branches/py3k/Modules/_pickle.c
==============================================================================
--- python/branches/py3k/Modules/_pickle.c	(original)
+++ python/branches/py3k/Modules/_pickle.c	Fri Apr 3 06:17:41 2009
@@ -691,9 +691,9 @@
 
 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 @@
 if (self->memo == NULL)
 return -1;
 
+ self->last_string = NULL;
+ self->arg = NULL;
+
 return 0;
 }
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /