Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > IDLE traceback on sys.exit()

Reply
Thread Tools

IDLE traceback on sys.exit()

 
 
Dave Harris
Guest
Posts: n/a
 
      11-02-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"raise (type, value, traceback)" and "raise type, value, traceback" Jack Bates Python 0 05-02-2011 05:23 PM
Re: ICMP traceback Terry Baranski Cisco 0 06-20-2004 02:06 PM
Random traceback user@domain.invalid Python 1 12-03-2003 12:23 PM
>>> python test1.py / Traceback ( File "<interactive input>", line 1 leroybt.rm Python 2 11-26-2003 01:35 AM
Issue with exception info formatting by traceback module Jan Decaluwe Python 0 11-07-2003 11:39 AM



Advertisments