IDLE traceback on sys.exit()

D

Dave Harris

Something to think about...I'm not sure if this is a problem for anyone.

IDLE currently issues a traceback when running a program which contains sys.exit(). For example, the program:

if __name__ == "__main__":
sys.exit(False)

shows the following in the IDLE shell window:

Traceback (most recent call last):
File "C:\rascal\dev\pylearn\odbchelpertest.py", line 8, in -toplevel-
sys.exit(False)
SystemExit: False

If that's the way it's supposed to work, fine.

But unittest wraps up the runTests() function with the line:

sys.exit(not result.wasSuccessful())

So, I always get a traceback whenever I run a test program in IDLE. (The command-line invocation works silently, which I would expect.)

My resolution is simple: I won't use IDLE to exercise my unit tests.

Python 2.3b2 (#43, Jun 29 2003, 16:43:04) [MSC v.1200 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
IDLE 1.0b2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top