[Python-Dev] exceptions trouble

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Wed, 28 Jun 2000 23:19:36 +0200


import traceback
try:
    raise SyntaxError, "argument"
except:
    traceback.print_exc()

prints:

Traceback (most recent call last):
  File "test.py", line 3, in ?
    raise SyntaxError, "argument"
Traceback (most recent call last):
  File "test.py", line 5, in ?
    traceback.print_exc()
  File "C:\py16\lib\traceback.py", line 182, in print_exc
    print_exception(etype, value, tb, limit, file)
  File "C:\py16\lib\traceback.py", line 110, in print_exception
    lines =3D format_exception_only(etype, value)
  File "C:\py16\lib\traceback.py", line 169, in format_exception_only
    list.append('%s: %s\n' % (str(stype), str(value)))
SystemError: new style getargs format but argument is not a tuple

not really what I expected.  am I out of sync, or have I
stumbled upon a bug in the new exceptions code?

</F>