Author: Armin Rigo <[email protected]>
Branch:
Changeset: r55685:7b07f9f1df29
Date: 2012-06-15 17:27 +0200
http://bitbucket.org/pypy/pypy/changeset/7b07f9f1df29/
Log: It seems that some versions of ctypes, maybe, return 2 from
c_bool(2).value.
diff --git a/pypy/rpython/lltypesystem/ll2ctypes.py
b/pypy/rpython/lltypesystem/ll2ctypes.py
--- a/pypy/rpython/lltypesystem/ll2ctypes.py
+++ b/pypy/rpython/lltypesystem/ll2ctypes.py
@@ -1234,6 +1234,8 @@
# upgrade to a more recent ctypes (e.g. 1.0.2) if you get
# an OverflowError on the following line.
cvalue = ctypes.cast(ctypes.c_void_p(cvalue), cresulttype)
+ elif RESTYPE == lltype.Bool:
+ cvalue = bool(cvalue)
else:
try:
cvalue = cresulttype(cvalue).value # mask high bits off if needed
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit