From: Andrew Svetlov Date: Sun, 9 Dec 2012 22:05:08 +0000 (+0200) Subject: Issue #16582: use int exit code in tkinter._exit X-Git-Tag: v2.7.4rc1~314 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=33b9b71e8dbddf081bd5e7dbf65166ca5d4d75c2;p=thirdparty%2FPython%2Fcpython.git Issue #16582: use int exit code in tkinter._exit --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index cec31fd9ab12..4791950bbaca 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