]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #16582: use int exit code in tkinter._exit
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Sun, 9 Dec 2012 22:05:08 +0000 (00:05 +0200)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Sun, 9 Dec 2012 22:05:08 +0000 (00:05 +0200)
Lib/lib-tk/Tkinter.py

index cec31fd9ab12bd2eabfb78303c336e47d9420e22..4791950bbaca0dd46eb25f3cab0562cb8dbf7c84 100644 (file)
@@ -154,8 +154,12 @@ def _tkerror(err):
     """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