[Python-checkins] cpython (3.2): Issue #16582: use int exit code in tkinter._exit

andrew.svetlov python-checkins at python.org
Sun Dec 9 23:05:22 CET 2012


http://hg.python.org/cpython/rev/fed68e0bce53
changeset:   80792:fed68e0bce53
branch:      3.2
parent:      80789:e1ba514ddcd2
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Mon Dec 10 00:02:31 2012 +0200
summary:
  Issue #16582: use int exit code in tkinter._exit

files:
  Lib/tkinter/__init__.py |  6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -146,8 +146,12 @@
     """Internal function."""
     pass
 
-def _exit(code='0'):
+def _exit(code=0):
     """Internal function. Calling it will throw the exception SystemExit."""
+    try:
+        code = int(code)
+    except ValueError:
+        pass
     raise SystemExit(code)
 
 _varnum = 0

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list