[IronPython] Prevention of SystemExit Dialog While Debugging

Jones, Larry Larry.Jones at aspentech.com
Tue Aug 31 01:40:16 CEST 2010



Thanks for the information. My code calls unittest.main().


I could not locate the 2.7 version of unittest.main that accepted the
exit=False parameter. I suspect it is in the CodePlex source code tree
and not in the downloaded V7.2a1. 


I will probably utilize the solution suggested by Dino and trap the
error if my process is attached to a debugger.


It may not the best solution, but adequate for my prototype.


Have a great day!


From: Michael Foord [mailto:fuzzyman at voidspace.org.uk] 
Sent: Monday, August 30, 2010 4:25 PM
To: Discussion of IronPython
Cc: Jones, Larry; users-ironpython.com at lists.ironpython.com
Subject: Re: [IronPython] Prevention of SystemExit Dialog While


On 31/08/2010 00:13, Jones, Larry wrote: 

I'm writing unit tests in IronPython.


The implementation of unittest.main() calls sys.exit() when finished
even if no testing errors occurred. Consequently, the Visual Studio
debugger presents a dialog indicating that the SystemExit exception was
unhandled.  Running from the console, I do not see any evidence of the
SystemExit exception. Because my colleagues are not familiar with
IronPython, seeing this error in the debugger will cause them to think
that some problem occurred on exit.


Is your code calling unittest.main() or is Visual Studio calling it for

In the version of unittest that comes with Python 2.7 you can call
unittest.main(exit=False). Alternatively you can just catch and ignore
this exception yourself.

All the best,


Although I suspect I can configure Visual Studio to ignore this
exception, I'd prefer not to because it may indicate an actual problem.


How can I determine if an IronPython script is running under the VS




Have a great day!


This e-mail and any attachments are intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information. If you are not the intended recipient of this
e-mail, you are hereby notified any dissemination, distribution or
copying of this email, and any attachments thereto, is strictly
prohibited. If you receive this email in error please immediately notify
the sender and permanently delete the original copy and any copy of any
e-mail, and any printout thereof. 

Users mailing list
Users at lists.ironpython.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100830/2c931a82/attachment-0001.html>

More information about the Ironpython-users mailing list