wxDateTime.ParseDate does not throw exception

Hi,
Am I missing something or is it true that the ParseDate() method of
wxDateTime doesn't throw an exception that Python catches?

E.g.,

    dt = wxDateTime()
    try:
        dt.ParseDate('asdf')
    except:
        print 'exception'

will result in an assert rather than 'exception' being printed.

-Rick King

Rick King wrote:

Hi,
Am I missing something or is it true that the ParseDate() method of
wxDateTime doesn't throw an exception that Python catches?

E.g.,

    dt = wxDateTime()
    try:
        dt.ParseDate('asdf')
    except:
        print 'exception'

will result in an assert rather than 'exception' being printed.

If there was an assert then you would have gotten an exception. What you are probably seeing is a log message. Try checking the return value instead. It should return the position in the string where parsing stopped, or -1 if there was an error.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!