diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-14 21:18:31 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-14 21:18:31 +0300 |
commit | c1d9bb342c40ba1e7b0cf69214726d269f1d74db (patch) | |
tree | f971494fc467034d9f7ac082fc9930d76dde5764 /Python/formatter_unicode.c | |
parent | 8664b17c9457da72299bf05ca734b02c6cea00f1 (diff) | |
parent | b0e630183e0663e0651c5d8fe54a15fb46699d0c (diff) | |
download | cpython-c1d9bb342c40ba1e7b0cf69214726d269f1d74db.tar.gz |
Issue #22384: An exception in Tkinter callback no longer crashes the program
when it is run with pythonw.exe.
Documented that Tk.report_callback_exception() is purposed to be overriden in
applications.
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r-- | Python/formatter_unicode.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index e3a8149841..056bb76902 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -846,6 +846,13 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format, " format specifier 'c'"); goto done; } + /* error to request alternate format */ + if (format->alternate) { + PyErr_SetString(PyExc_ValueError, + "Alternate form (#) not allowed with integer" + " format specifier 'c'"); + goto done; + } /* taken from unicodeobject.c formatchar() */ /* Integer input truncated to a character */ |