Hello, I was looking at adding a handler for otherwise-uncaught .Net exceptions, and had found this page: <a href="http://www.ironpython.info/index.php/Handling_Unhandled_Exceptions">http://www.ironpython.info/index.php/Handling_Unhandled_Exceptions</a> useful. However, the code shown falls over where he's trying to get a nicely formatted python exception here:<br>
<br><pre> from IronPython.Hosting import PythonEngine
pyE = PythonEngine()
print pyE.FormatException(event.Exception)</pre>where I get "ImportError: No module named Hosting". At the bottom he has a note saying:<br><br><p>"For IronPython 2.0, the code to format the exception from a PythonEngine is slightly different:
</p>
<pre>import clr
clr.AddReference('IronPython')
from IronPython.Hosting import PythonEngine
PythonEngine.CurrentEngine.FormatException(someException)
</pre>"<br><br>which gives me "ImportError: Cannot import name PythonEngine".<br><br>I'm using IronPython 2.7.0.40 with .Net 4.0.30319.239. I assume the API has changed here; can anyone tell me if there is a way to do something like this FormatException in IronPython 2.7?<br>
<br>Thanks.<br>