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