string exceptions

Issue #19 open
Former user created an issue

Source seems to contain a lot of string exceptions, resulting in:

TypeError: exceptions must be old-style classes or derived from BaseException, not str

Comments (4)

  1. James Taylor repo owner

    What version of the Python interpreter are you seeing this with? String exceptions have been deprecated, but they were not supposed to be removed until Python 3.0 I thought (according to PEP 317). bx-python is currently only available for Python 2.

  2. Anonymous

    I'm using Python 2.6.5:

    Python 2.6.5 (r265:79063, Apr 13 2010, 15:07:42) [GCC 4.0.1 (Apple Inc. build 5484)] on darwin


  3. Bob Harris

    (Reply via

    I'm pretty sure the intent of these string exceptions was to get a message to the user. So, if none of them are trapped by calling routines, an easy short term fix would be to change them to asserts, i.e. "raise s" becomes "assert False, s".

  4. Log in to comment