cpython: 9095a5787a82 (original) (raw)

Mercurial > cpython

changeset 100165:9095a5787a82

Fix issue 26287: While handling FORMAT_VALUE opcode, the top of stack was being corrupted if an error occurred in PyObject_Format(). [#26287]

Eric V. Smith eric@trueblade.com
date Fri, 05 Feb 2016 18:23:08 -0500
parents d3be5c4507b4
children f6a89f6cadd0
files Lib/test/test_fstring.py Python/ceval.c
diffstat 2 files changed, 13 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_fstring.py 11 Python/ceval.c 4

line wrap: on

line diff

--- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -692,6 +692,17 @@ 4}''', '7') r"f'{a(4]}'", ])

+ def test_loop(self): for i in range(1000): self.assertEqual(f'i:{i}', 'i:' + str(i))

--- a/Python/ceval.c +++ b/Python/ceval.c @@ -3383,7 +3383,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int int have_fmt_spec = (oparg & FVS_MASK) == FVS_HAVE_SPEC; fmt_spec = have_fmt_spec ? POP() : NULL;

/* See if any conversion is specified. */ switch (which_conversion) { @@ -3426,7 +3426,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int goto error; }