Issue #16582: use int exit code in tkinter._exit
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Sun, 9 Dec 2012 22:02:31 +0000 (00:02 +0200)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Sun, 9 Dec 2012 22:02:31 +0000 (00:02 +0200)
Lib/tkinter/__init__.py

index 67a2f9a327fba680df57a2e90e09777f8ef7336a..70736623a187c0eef91349aae70245f7449a7c10 100644 (file)
@@ -146,8 +146,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