[pypy-svn] r74481 - pypy/trunk/pypy/module/cpyext

agaynor at codespeak.net agaynor at codespeak.net
Tue May 11 12:00:19 CEST 2010


Author: agaynor
Date: Tue May 11 12:00:18 2010
New Revision: 74481

Modified:
   pypy/trunk/pypy/module/cpyext/tupleobject.py
Log:
A little error checkint for _PyTuple_Resize, shoudl help with translating.

Modified: pypy/trunk/pypy/module/cpyext/tupleobject.py
==============================================================================
--- pypy/trunk/pypy/module/cpyext/tupleobject.py	(original)
+++ pypy/trunk/pypy/module/cpyext/tupleobject.py	Tue May 11 12:00:18 2010
@@ -61,6 +61,9 @@
     *p is destroyed.  On failure, returns -1 and sets *p to NULL, and
     raises MemoryError or SystemError."""
     py_tuple = from_ref(space, ref[0])
+    if not PyTuple_Check(space, py_tuple):
+        PyErr_BadInternalCall(space)
+    assert isinstance(py_tuple, W_TupleObject)
     py_newtuple = PyTuple_New(space, newsize)
     
     to_cp = newsize



More information about the Pypy-commit mailing list