From: Andrew Svetlov Date: Sun, 9 Dec 2012 22:02:31 +0000 (+0200) Subject: Issue #16582: use int exit code in tkinter._exit X-Git-Tag: v3.2.4rc1~282 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=806bfad45749f25f9d6ac1622598d348297e127b;p=thirdparty%2FPython%2Fcpython.git Issue #16582: use int exit code in tkinter._exit --- diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 67a2f9a327fb..70736623a187 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -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