summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2008-01-23 22:55:26 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2008-01-23 22:55:26 (GMT)
commitf30ba3dd662127e4896c1342894fd83cfbfedb51 (patch)
tree07feccf49a1a3bc199e7b7a3d2310c6ae371b2d8
parent6f4ee2d48f8a36314e1d64546a5106180f6907b3 (diff)
downloadcpython-f30ba3dd662127e4896c1342894fd83cfbfedb51.zip
cpython-f30ba3dd662127e4896c1342894fd83cfbfedb51.tar.gz
cpython-f30ba3dd662127e4896c1342894fd83cfbfedb51.tar.bz2
There was an error on exit if no sys.exitfunc was defined. Issue 1647.
-rw-r--r--Lib/idlelib/NEWS.txt2
-rw-r--r--Lib/idlelib/run.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index d931e98..18d2315 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -3,6 +3,8 @@ What's New in IDLE 2.6a1?
*Release date: XX-XXX-2008*
+- There was an error on exit if no sys.exitfunc was defined. Issue 1647.
+
- Could not open files in .idlerc directory if latter was hidden on Windows.
Issue 1743, Issue 1862.
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 4eb64d6..6e91982 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -206,7 +206,10 @@ def exit():
"""
if no_exitfunc:
- del sys.exitfunc
+ try:
+ del sys.exitfunc
+ except AttributeError:
+ pass
sys.exit(0)
class MyRPCServer(rpc.RPCServer):