Unverified Kaydet (Commit) 26f55c29 authored tarafından Pablo Galindo's avatar Pablo Galindo Kaydeden (comit) GitHub

bpo-36817: Do not decrement reference for expr_text on fstring = parsing failure (GH-13256)

üst 5833e94d
...@@ -1148,6 +1148,8 @@ non-important content ...@@ -1148,6 +1148,8 @@ non-important content
self.assertEqual(f'{C()=:x}', 'C()=FORMAT-x') self.assertEqual(f'{C()=:x}', 'C()=FORMAT-x')
self.assertEqual(f'{C()=!r:*^20}', 'C()=********REPR********') self.assertEqual(f'{C()=!r:*^20}', 'C()=********REPR********')
self.assertRaises(SyntaxError, eval, "f'{C=]'")
def test_walrus(self): def test_walrus(self):
x = 20 x = 20
# This isn't an assignment expression, it's 'x', with a format # This isn't an assignment expression, it's 'x', with a format
......
...@@ -5283,7 +5283,6 @@ unexpected_end_of_string: ...@@ -5283,7 +5283,6 @@ unexpected_end_of_string:
/* Falls through to error. */ /* Falls through to error. */
error: error:
Py_XDECREF(expr_text);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment