summaryrefslogtreecommitdiff
path: root/Lib/lib-tk/Tkinter.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib-tk/Tkinter.py')
-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 cec31fd9ab..4791950bba 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