[pypy-svn] r79590 - pypy/branch/psycopg2compatibility/pypy/module/cpyext

dan at codespeak.net dan at codespeak.net
Sat Nov 27 04:09:59 CET 2010


Author: dan
Date: Sat Nov 27 04:09:56 2010
New Revision: 79590

Modified:
   pypy/branch/psycopg2compatibility/pypy/module/cpyext/pyobject.py
Log:
It translates!

Modified: pypy/branch/psycopg2compatibility/pypy/module/cpyext/pyobject.py
==============================================================================
--- pypy/branch/psycopg2compatibility/pypy/module/cpyext/pyobject.py	(original)
+++ pypy/branch/psycopg2compatibility/pypy/module/cpyext/pyobject.py	Sat Nov 27 04:09:56 2010
@@ -171,7 +171,10 @@
         lifeline = self.lifeline_dict.get(w_obj)
         if lifeline is not None: # make old PyObject ready for use in C code
             py_obj = lifeline.pyo
-            assert py_obj.c_ob_refcnt == 0, "%r refcount %d" % (py_obj, py_obj.c_ob_refcnt)
+            if we_are_translated():
+                assert py_obj.c_ob_refcnt == 0
+            else:
+                assert py_obj.c_ob_refcnt == 0, "%r refcount %d" % (py_obj, py_obj.c_ob_refcnt)
             return py_obj
         else:
             return lltype.nullptr(PyObject.TO)



More information about the Pypy-commit mailing list