[pypy-svn] r72620 - pypy/branch/cpython-extension/pypy/module/cpyext/test

afa at codespeak.net afa at codespeak.net
Tue Mar 23 14:23:53 CET 2010


Author: afa
Date: Tue Mar 23 14:23:52 2010
New Revision: 72620

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/test/foo.c
Log:
Avoid the NullPointerException that masks the previous error


Modified: pypy/branch/cpython-extension/pypy/module/cpyext/test/foo.c
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/test/foo.c	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/test/foo.c	Tue Mar 23 14:23:52 2010
@@ -138,6 +138,7 @@
 	if (m == NULL)
 	    return;
 	d = PyModule_GetDict(m);
-	PyDict_SetItemString(d, "fooType", (PyObject *)&footype);
+	if (d)
+	    PyDict_SetItemString(d, "fooType", (PyObject *)&footype);
    	/* No need to check the error here, the caller will do that */
 }



More information about the Pypy-commit mailing list