summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-09-13 23:40:27 -0700
committerNed Deily <nad@acm.org>2014-09-13 23:40:27 -0700
commit4278e8cf357c7418651ca0e23346b2ddec74edce (patch)
treea3c23ca1ef525340d98e01bb53fc9e6785ce45ff /Python/formatter_unicode.c
parent0d48f974662035c14912d225b71b6cf93b621bb0 (diff)
parent0675102eeb39b5bf471af40e8af6729102fccc6b (diff)
downloadcpython-4278e8cf357c7418651ca0e23346b2ddec74edce.tar.gz
Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r--Python/formatter_unicode.c7
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 */