[Zodb-checkins] CVS: Zope3/lib/python/Persistence - cPersistence.c:1.28

Jeremy Hylton jeremy@zope.com
Fri, 22 Nov 2002 09:52:23 -0500


Update of /cvs-repository/Zope3/lib/python/Persistence
In directory cvs.zope.org:/tmp/cvs-serv21906

Modified Files:
	cPersistence.c 
Log Message:
Add assert() about dict ptr; this is the only C code that changed
recently, perhaps it fails on some plaforms.

Also, fix wordo in comment.


=== Zope3/lib/python/Persistence/cPersistence.c 1.27 => 1.28 ===
--- Zope3/lib/python/Persistence/cPersistence.c:1.27	Fri Nov 22 00:33:58 2002
+++ Zope3/lib/python/Persistence/cPersistence.c	Fri Nov 22 09:52:22 2002
@@ -154,7 +154,7 @@
 
 /* XXX What's the contract of __setstate__() if the object already has
    state?  Should it update the state or should it replace the state?
-   A class to __setstate__() seems most likely intended to replace the
+   A call to __setstate__() seems most likely intended to replace the
    old state with a new state, so clear first.
 */
 
@@ -172,6 +172,7 @@
     }
 
     pdict = _PyObject_GetDictPtr(self);
+    assert(pdict); /* not sure if this can return NULL */
     if ((*pdict) == NULL) {
 	*pdict = PyDict_New();
 	if ((*pdict) == NULL)