Commits

Armin Rigo committed 237b4e4

Update to cffi/184ddf196151

Comments (0)

Files changed (2)

pypy/module/_cffi_backend/cdataobj.py

 W_CData.typedef = TypeDef(
     'CData',
     __module__ = '_cffi_backend',
+    __name__ = '<cdata>',
     __repr__ = interp2app(W_CData.repr),
     __nonzero__ = interp2app(W_CData.nonzero),
     __int__ = interp2app(W_CData.int),

pypy/module/_cffi_backend/test/_backend_test_c.py

     c[1:3] = d
     assert list(c) == [0, 40, 50, 30, 0]
 
+def test_cdata_name_module_doc():
+    p = new_primitive_type("signed char")
+    x = cast(p, 17)
+    assert x.__module__ == '_cffi_backend'
+    assert x.__name__ == '<cdata>'
+    assert hasattr(x, '__doc__')
+
 def test_version():
     # this test is here mostly for PyPy
     assert __version__ == "0.6"