GH-103718: Correctly cache and restore f-string buffers when needed (GH-103719)

This commit is contained in:
Lysandros Nikolaou 2023-04-23 13:06:10 -06:00 committed by GitHub
parent 5041c2ba6e
commit 05b3ce7339
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 11 deletions

View file

@ -1532,5 +1532,10 @@ x = (
"f-string: expecting a valid expression after '{'"):
compile("f'{**a}'", "?", "exec")
def test_not_closing_quotes(self):
self.assertAllRaise(SyntaxError, "unterminated f-string literal", ['f"', "f'"])
self.assertAllRaise(SyntaxError, "unterminated triple-quoted f-string literal",
['f"""', "f'''"])
if __name__ == '__main__':
unittest.main()