IDLE traceback on sys.exit()

Discussion in 'Python' started by Dave Harris, Nov 2, 2003.

  1. Dave Harris

    Dave Harris Guest

    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
    Dave Harris, Nov 2, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GinTon

    sys.stderr.write and sys.exit

    GinTon, Nov 23, 2006, in forum: Python
    Replies:
    5
    Views:
    568
    Dennis Lee Bieber
    Nov 24, 2006
  2. Yujo
    Replies:
    2
    Views:
    394
    Gabriel Genellina
    Apr 10, 2007
  3. Replies:
    3
    Views:
    287
    Gabriel Genellina
    Jul 13, 2007
  4. Harlin Seritt

    Sys.exit() does not fully exit

    Harlin Seritt, Feb 17, 2008, in forum: Python
    Replies:
    3
    Views:
    273
    Christian Heimes
    Feb 17, 2008
  5. Brendan

    exit() or sys.exit()

    Brendan, Jun 17, 2009, in forum: Python
    Replies:
    2
    Views:
    345
    Brendan
    Jun 17, 2009
Loading...

Share This Page