From 809f90f36905e7623eb98bf216c078a90a4090bd Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Tue, 15 Apr 2014 13:52:21 +0100 Subject: Reverted 16efa8d27e4c after discussion with Eric. --- Lib/test/test_types.py | 2 -- Misc/NEWS | 4 ---- Python/formatter_unicode.c | 7 ------- 3 files changed, 13 deletions(-) diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 11d9546..ec10752 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -343,8 +343,6 @@ class TypesTests(unittest.TestCase): self.assertRaises(ValueError, 3 .__format__, ",n") # can't have ',' with 'c' self.assertRaises(ValueError, 3 .__format__, ",c") - # can't have '#' with 'c' - self.assertRaises(ValueError, 3 .__format__, "#c") # ensure that only int and float type specifiers work for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] + diff --git a/Misc/NEWS b/Misc/NEWS index 26377fe..271898c 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -34,10 +34,6 @@ Core and Builtins replacement fields. It now matches the behavior of str.format() in this regard. Patches by Phil Elson and Ramchandra Apte. -- Issue #8931: Make alternate formatting ('#') for type 'c' raise an - exception. It had no effect, now trying to specify it is an error. - Patch by Torsten Landschoff. - Library ------- diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index 056bb76..e3a8149 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -846,13 +846,6 @@ 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 */ -- cgit v0.12