summaryrefslogtreecommitdiffstats
path: root/Parser/bitset.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-04-11 02:59:48 (GMT)
committerTim Peters <tim.peters@gmail.com>2006-04-11 02:59:48 (GMT)
commit319c47fcdb3b8196cc580c4fab409b0ee58119fe (patch)
treef5421caaeb93c938304e74de90f284ab420d9bc3 /Parser/bitset.c
parent171b868195d6f4ffc08a94ff3cf02fde74f6e576 (diff)
downloadcpython-319c47fcdb3b8196cc580c4fab409b0ee58119fe.zip
cpython-319c47fcdb3b8196cc580c4fab409b0ee58119fe.tar.gz
cpython-319c47fcdb3b8196cc580c4fab409b0ee58119fe.tar.bz2
Try to repair what may be the last new test failure on the
"x86 OpenBSD trunk" buildbot due to changing Python so that Python-exposed addresses are always non-negative. test_int_pointer_arg(): This line failed now whenever the box happened to assign an address to `ci` "with the sign bit set": self.failUnlessEqual(addressof(ci), func(byref(ci))) The problem is that the ctypes addressof() inherited "all addresses are non-negative now" from changes to PyLong_FromVoidPtr(), but byref() did not inherit that change and can still return a negative int. I don't know whether, or what, the ctypes implementation wants to do about that (possibly nothing), but in the meantime the test fails frequently. So, introduced a Python positive_address() function in the test module, that takes a purported machine address and, if negative, converts it to a non-negative value "with the same bits". This should leave the test passing under all versions of Python. Belated thanks to Armin Rigo for teaching me the sick trick ;-) for determining the # of bits in a machine pointer via abuse of the struct module.
Diffstat (limited to 'Parser/bitset.c')
0 files changed, 0 insertions, 0 deletions