diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2003-05-17 21:04:10 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2003-05-17 21:04:10 (GMT) |
commit | a2792bec1ddfc3f5e38f202de8bc5ca9db4bb869 (patch) | |
tree | c8d854dce66ceda50d15964c73d6a2b40f840af1 /Lib/idlelib/run.py | |
parent | 74e67661a69ddb43a21a486c66965a052540cdd0 (diff) | |
download | cpython-a2792bec1ddfc3f5e38f202de8bc5ca9db4bb869.zip cpython-a2792bec1ddfc3f5e38f202de8bc5ca9db4bb869.tar.gz cpython-a2792bec1ddfc3f5e38f202de8bc5ca9db4bb869.tar.bz2 |
Show Freddy the mirror
i.e. improve subprocess exit paths and exeception reporting
Diffstat (limited to 'Lib/idlelib/run.py')
-rw-r--r-- | Lib/idlelib/run.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index ad23793..98255c7 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -53,7 +53,7 @@ def main(): while 1: try: if exit_requested: - os._exit(0) + sys.exit(0) try: seq, request = rpc.request_queue.get(0) except Queue.Empty: @@ -64,9 +64,15 @@ def main(): rpc.response_queue.put((seq, ret)) except KeyboardInterrupt: continue + except SystemExit: + raise except: - print_exception() - rpc.response_queue.put((seq, None)) + try: + print_exception() + rpc.response_queue.put((seq, None)) + except: + traceback.print_exc(file=sys.__stderr__) + sys.exit(1.1) continue def manage_socket(address): @@ -207,13 +213,15 @@ class Executive: try: exec code in self.locals except: + if exit_requested: + sys.exit(0) try: - if exit_requested: - os._exit(0) + # even print a user code SystemExit exception, continue print_exception() except: - sys.stderr = sys.__stderr__ - raise + # link not working? + traceback.print_exc(file=sys.__stderr__) + sys.exit(1.2) else: flush_stdout() |