Hi all,
I ported ctypes 0.9.2 to QNX6.3 ... 99.9 % is working but only the unittest test_functions.py makes some problem. Here is the code:
p = pointer(c_int(99)) result = f(p) self.failUnlessEqual(result.contents.value, 99) #---> works!!
# We need to keep the pointer alive, otherwise the contents change:
result = f(pointer(c_int(99)))
print result.contents.value
self.failIfEqual(result.contents.value, 99)Error message:
# python test_functions.py
..........99
F.....
======================================================================
FAIL: test_pointers (__main__.FunctionTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_functions.py", line 194, in test_pointers
self.failIfEqual(result.contents.value, 99)
File "/usr/local/lib/python2.3/unittest.py", line 310, in failIfEqual
raise self.failureException, \
AssertionError: 99 == 99What's the problem here? 99 isn't equal 99 :)
---------------------------------------------------------------------- Ran 16 tests in 0.053s
FAILED (failures=1) #
# XXX But this not! WHY on earth? ====>> BUT this IS working!! arg = byref(v) result = f(arg) self.failIfEqual(result.contents, v.value)
I see always a crash of Python if the library call time() is used ... but it happens only with this call.
What could be in general the reasons??
Regards
Armin
-- http://mail.python.org/mailman/listinfo/python-list
