From 38fd069a73adb81104927aeb13a8919214d18dfa Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Thu, 14 Feb 2008 04:45:30 +0000 Subject: [PATCH] There was an error on exit if no sys.exitfunc was defined. Issue 1647. Backport r60227 --- Lib/idlelib/NEWS.txt | 3 +++ Lib/idlelib/run.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 06e4ad44411..f8931b328cc 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ What's New in IDLE 1.2.2c1? *Release date: XX-FEB-2008* +- There was an error on exit if no sys.exitfunc was defined. Issue 1647. + (backport r60227) + - Could not open files in .idlerc directory if latter was hidden on Windows. Issue 1743, Issue 1862. (backport r60225, r60745) diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index ae810c4ecc7..5560af81a2e 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -205,7 +205,10 @@ def exit(): """ if no_exitfunc: - del sys.exitfunc + try: + del sys.exitfunc + except AttributeError: + pass sys.exit(0) class MyRPCServer(rpc.RPCServer):