New issue 2813: seems bug in ctypes
https://bitbucket.org/pypy/pypy/issues/2813/seems-bug-in-ctypes

刘穆清:

```
#!python
from ctypes import *
class Context(Structure):
    pass

PtrTypeOfContext = POINTER(Context)

LIB = cdll.LoadLibrary("./test.so")
LIB.test.restype = Context
LIB.test.argtypes = []

Context._fields_ = [
        ("a", c_char_p),
        ("b", c_char_p),
        ("c", c_char_p),
        ("d", c_char_p),
    ]
c = Context()
v = LIB.test(c)
print (v.a)
print (v.b)
print (v.c)
print (v.d)
```

this code can be run in CPython, but in pypy, it will raise `SystemError: not 
supported by libffi`

and If I comment line 5, pypy will be good


_______________________________________________
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to