Can someone explain why when comparing a wxDateTime to None python
segfaults? This is on wxPython 2.3.2.1, Python 2.1.2, Debian GNU/Linux
(sid).
Here is a (very) simple test script:
## begin Python code
from wxPython.wx import *
if wxDateTime_Today() == None:
print "I made it!"
## end Python code
here is what I get when running python from gdb:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 1490)]
0x40a486a9 in wxDateTime___cmp__ (self=0x81f57b0, other=@0x0)
at /usr/include/wx/datetime.inl:138
138 return m_time;
You should rather check whether
wxDateTime_Today() is None:
print "This makes more sense"
Quite true, since rich comparisons were added, the == None construct
doesn't work reliably. However, it shouldn't segfault either. I supect a
problem with mxDateTime.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception