summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-09 22:05:08 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-09 22:05:08 (GMT)
commit33b9b71e8dbddf081bd5e7dbf65166ca5d4d75c2 (patch)
tree65554c8b82cf1582e7796916cbad57ee7fdba81b /Lib
parentbfb0989ea738b2fc7e79de4907b02d8a964a4960 (diff)
downloadcpython-33b9b71e8dbddf081bd5e7dbf65166ca5d4d75c2.zip
cpython-33b9b71e8dbddf081bd5e7dbf65166ca5d4d75c2.tar.gz
cpython-33b9b71e8dbddf081bd5e7dbf65166ca5d4d75c2.tar.bz2
Issue #16582: use int exit code in tkinter._exit
Diffstat (limited to 'Lib')
-rw-r--r--Lib/lib-tk/Tkinter.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index cec31fd..4791950 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -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