From 33b9b71e8dbddf081bd5e7dbf65166ca5d4d75c2 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Mon, 10 Dec 2012 00:05:08 +0200 Subject: Issue #16582: use int exit code in tkinter._exit --- Lib/lib-tk/Tkinter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v0.12