我試圖與Pypy
一起工作,但只要我執行我的代碼Pypy
失敗,但cPython
工作。Pypy錯誤:RuntimeWarning:C函數沒有聲明的參數調用,usinc ctypes
我發現了幾個問題,圍繞谷歌上搜索有關的ctypes和pypy,但我不能夠找到錯誤在我的代碼:
libc = CDLL("libc.so.6")
ptr = c_void_p(None)
result = libc.getifaddrs(pointer(ptr))
if result:
return None
ifa = ifaddrs.from_address(ptr.value)
result = {}
的代碼失敗在呼叫libc.getifaddrs(pointer(ptr))
,返回:
102: RuntimeWarning: C function without declared arguments called result = libc.getifaddrs(pointer(ptr))
任何想法是怎麼回事?
謝謝!
這一警告也CPython的下存在delcare他們,你的代碼顯示觸發它符合條件。嘗試明確地打開警告。 – delnan