summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorXtreak <tir.karthi@gmail.com>2019-01-07 15:09:14 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-01-07 15:09:14 (GMT)
commit3f7983a25a3d19779283c707fbdd5bc91b1587ef (patch)
treebe67585aae69489545dcccfa2938a3274b811b7e /Objects
parenta0bb51e44cd43a7d2836a96a3804162203e44514 (diff)
downloadcpython-3f7983a25a3d19779283c707fbdd5bc91b1587ef.zip
cpython-3f7983a25a3d19779283c707fbdd5bc91b1587ef.tar.gz
cpython-3f7983a25a3d19779283c707fbdd5bc91b1587ef.tar.bz2
bpo-35560: Remove assertion from format(float, "n") (GH-11288)
Fix an assertion error in format() in debug build for floating point formatting with "n" format, zero padding and small width. Release build is not impacted. Patch by Karthikeyan Singaravelan.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index f1dcfe9..304ea74 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -9381,6 +9381,7 @@ _PyUnicode_InsertThousandsGrouping(
PyObject *thousands_sep,
Py_UCS4 *maxchar)
{
+ min_width = Py_MAX(0, min_width);
if (writer) {
assert(digits != NULL);
assert(maxchar == NULL);
@@ -9391,7 +9392,6 @@ _PyUnicode_InsertThousandsGrouping(
}
assert(0 <= d_pos);
assert(0 <= n_digits);
- assert(0 <= min_width);
assert(grouping != NULL);
if (digits != NULL) {