Author: mattip <[email protected]>
Branch: cpyext-gc-support-2
Changeset: r82273:068b526e7520
Date: 2016-02-15 21:42 +0200
http://bitbucket.org/pypy/pypy/changeset/068b526e7520/
Log: fixes in tests
diff --git a/pypy/module/cpyext/test/test_api.py
b/pypy/module/cpyext/test/test_api.py
--- a/pypy/module/cpyext/test/test_api.py
+++ b/pypy/module/cpyext/test/test_api.py
@@ -64,7 +64,7 @@
raise
try:
- del self.space.getexecutioncontext().cpyext_threadstate
+ self.space.getexecutioncontext().cleanup_cpyext_threadstate()
except AttributeError:
pass
diff --git a/pypy/module/cpyext/test/test_stringobject.py
b/pypy/module/cpyext/test/test_stringobject.py
--- a/pypy/module/cpyext/test/test_stringobject.py
+++ b/pypy/module/cpyext/test/test_stringobject.py
@@ -28,7 +28,7 @@
if(PyString_Size(s) == 11) {
result = 1;
}
- if(s->ob_type->tp_basicsize != sizeof(void*)*4)
+ if(s->ob_type->tp_basicsize != sizeof(void*)*5)
result = 0;
Py_DECREF(s);
return PyBool_FromLong(result);
diff --git a/rpython/rtyper/lltypesystem/ll2ctypes.py
b/rpython/rtyper/lltypesystem/ll2ctypes.py
--- a/rpython/rtyper/lltypesystem/ll2ctypes.py
+++ b/rpython/rtyper/lltypesystem/ll2ctypes.py
@@ -530,6 +530,7 @@
# Ctypes-aware subclasses of the _parentable classes
ALLOCATED = {} # mapping {address: _container}
+DEBUG_ALLOCATED = True
def get_common_subclass(cls1, cls2, cache={}):
"""Return a unique subclass with (cls1, cls2) as bases."""
@@ -569,7 +570,8 @@
raise Exception("internal ll2ctypes error - "
"double conversion from lltype to ctypes?")
# XXX don't store here immortal structures
- print "LL2CTYPES:", addr
+ if DEBUG_ALLOCATED:
+ print "LL2CTYPES:", hex(addr)
ALLOCATED[addr] = self
def _addressof_storage(self):
@@ -582,7 +584,8 @@
self._check() # no double-frees
# allow the ctypes object to go away now
addr = ctypes.cast(self._storage, ctypes.c_void_p).value
- print "LL2C FREE:", addr
+ if DEBUG_ALLOCATED:
+ print "LL2C FREE:", hex(addr)
try:
del ALLOCATED[addr]
except KeyError:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit