diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-01-07 07:26:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-07 07:26:20 -0800 |
commit | 9a413faa8708e5c2df509e97d48f18685c198b24 (patch) | |
tree | 70f5333f38a6693f9b4a9f7c422d6a5115d2bbe0 /Objects | |
parent | 65ed9f31cf2239b4d41d959b270f5d5dd0adcdbe (diff) | |
download | cpython-git-9a413faa8708e5c2df509e97d48f18685c198b24.tar.gz |
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.
(cherry picked from commit 3f7983a25a3d19779283c707fbdd5bc91b1587ef)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index d46ab2a1e2..35c8a24b7c 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -9356,6 +9356,7 @@ _PyUnicode_InsertThousandsGrouping( PyObject *thousands_sep, Py_UCS4 *maxchar) { + min_width = Py_MAX(0, min_width); if (writer) { assert(digits != NULL); assert(maxchar == NULL); @@ -9366,7 +9367,6 @@ _PyUnicode_InsertThousandsGrouping( } assert(0 <= d_pos); assert(0 <= n_digits); - assert(0 <= min_width); assert(grouping != NULL); if (digits != NULL) { |