summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorTim Peters <tim@python.org>2014-05-08 17:43:25 -0500
committerTim Peters <tim@python.org>2014-05-08 17:43:25 -0500
commit60e53efd0469216f6da024b116330ff008fb81ff (patch)
tree27ecf9fc560ccf370c7781709235c5397cc0d1a8 /Python/formatter_unicode.c
parent99c4936cf50197c654545b24fc625b7454ea42da (diff)
parent74339a075353dfb9256d2b746b4cd1daf78d2736 (diff)
downloadcpython-60e53efd0469216f6da024b116330ff008fb81ff.tar.gz
Merge from 3.4.
Issue #21435: Segfault in gc with cyclic trash Changed the iteration logic in finalize_garbage() to tolerate objects vanishing from the list as a side effect of executing a finalizer.
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 */