Trying to get the line number of an error. CPython produces:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11)
Type "help", "copyright", "credits" or "li
>>> def test():
... print "hi"
... int("hi")
...
>>> test()
hi
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<stdin>", line 3, in test
ValueError: invalid literal for int(): hi
Type "help", "copyright", "credits" or "li
>>> def test():
... print "hi"
... int("hi")
...
>>> test()
hi
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<stdin>", line 3, in test
ValueError: invalid literal for int(): hi
But IP RC2 produces:
IronPython 1.0.60816 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> def test():
... print "hi"
... int("hi")
...
>>> test()
hi
Traceback (most recent call last):
File , line 0, in <stdin>##5
File , line 0, in test
ValueError: invalid integer number literal
Copyright (c) Microsoft Corporation. All rights reserved.
>>> def test():
... print "hi"
... int("hi")
...
>>> test()
hi
Traceback (most recent call last):
File , line 0, in <stdin>##5
File , line 0, in test
ValueError: invalid integer number literal
How do I get the line number of this runtime error?
MattB
_______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
