eryksun added the comment: It works for me:
>>> open('test.c', 'w').write('long test(long x) {return x;}') >>> os.system('gcc -shared -fPIC -o test.so test.c') 0 >>> test = CDLL('./test.so').test >>> test.restype = c_long >>> test.argtypes = (c_long,) >>> test(2**63-1) == 2**63-1 True However, I used the correct attribute name, "argtypes". ctypes objects have dicts to allow setting arbitrary attribute names, so you won't get an AttributeError when setting "args" on a function pointer. ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24470> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com