Author: Armin Rigo <ar...@tunes.org>
Branch: ffi-backend
Changeset: r55766:4d4a1b6f0d45
Date: 2012-06-23 10:57 +0200
http://bitbucket.org/pypy/pypy/changeset/4d4a1b6f0d45/

Log:    Port the test; fix.

diff --git a/pypy/module/_ffi_backend/cdataobj.py 
b/pypy/module/_ffi_backend/cdataobj.py
--- a/pypy/module/_ffi_backend/cdataobj.py
+++ b/pypy/module/_ffi_backend/cdataobj.py
@@ -183,4 +183,4 @@
     __getitem__ = interp2app(W_CData.getitem),
     __setitem__ = interp2app(W_CData.setitem),
     )
-W_CData.acceptable_as_base_class = False
+W_CData.typedef.acceptable_as_base_class = False
diff --git a/pypy/module/_ffi_backend/ctypeobj.py 
b/pypy/module/_ffi_backend/ctypeobj.py
--- a/pypy/module/_ffi_backend/ctypeobj.py
+++ b/pypy/module/_ffi_backend/ctypeobj.py
@@ -293,4 +293,4 @@
     '_ffi_backend.CTypeDescr',
     __repr__ = interp2app(W_CType.repr),
     )
-W_CType.acceptable_as_base_class = False
+W_CType.typedef.acceptable_as_base_class = False
diff --git a/pypy/module/_ffi_backend/test/_backend_test_c.py 
b/pypy/module/_ffi_backend/test/_backend_test_c.py
--- a/pypy/module/_ffi_backend/test/_backend_test_c.py
+++ b/pypy/module/_ffi_backend/test/_backend_test_c.py
@@ -769,3 +769,19 @@
     weakref.ref(newp(BPtr, 42))
     py.test.raises(TypeError, weakref.ref, cast(BPtr, 42))
     py.test.raises(TypeError, weakref.ref, cast(BInt, 42))
+
+def test_no_inheritance():
+    BInt = new_primitive_type("int")
+    try:
+        class foo(type(BInt)): pass
+    except TypeError:
+        pass
+    else:
+        raise AssertionError
+    x = cast(BInt, 42)
+    try:
+        class foo(type(x)): pass
+    except TypeError:
+        pass
+    else:
+        raise AssertionError
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to