[IronPython] try breaks traceback

Howland-Rose, Kyle Kyle.Howland-Rose at aar.com.au
Fri Feb 13 00:22:37 CET 2009


Hi all,
 
ipy 2.0 traceback seems to lose track of where exceptions come from
inside try-except blocks (which hampers debugging):
 
bash-3.2$ cat foo.py
import bar
class E(Exception):
  def __init__(self, message):
    Exception.__init__(self, message)
try:
 bar.baz()
except E, ex:
 pass
 
bash-3.2$ cat bar.py
def baz():
 "".sort(key=key_comparer.key)
 
bash-3.2$ ipy foo.py
Traceback (most recent call last):
  File "foo.py", line 6, in foo.py
AttributeError: 'str' object has no attribute 'sort'bash-3.2$
 
if I take the try-except block out I get the correct module line number:
 
bash-3.2$ cat foo2.py
import bar
class E(Exception):
  def __init__(self, message):
    Exception.__init__(self, message)
bar.baz()
 
bash-3.2$ ipy foo2.py
Traceback (most recent call last):
  File "foo2.py", line 5, in foo2.py
  File "h:\jobs\chris21views\bar.py", line 2, in baz
AttributeError: 'str' object has no attribute 'sort'bash-3.2$
 
Before I raise a bug I thought I would just check that I am not missing
something here.
 
Thanks, Kyle

************************************************************************
 
Allens Arthur Robinson online: http://www.aar.com.au
 
This email is confidential and may be subject to legal or other professional privilege. It is also subject to copyright. If you have received it in error, confidentiality and privilege are not waived and you must not disclose or use the information in it. Please notify the sender by return email and delete it from your system. Any personal information in this email must be handled in accordance with the Privacy Act 1988 (Cth).
 
*************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090213/4db0a116/attachment.html>


More information about the Ironpython-users mailing list