mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)
This commit is contained in:
parent
dd53b79de0
commit
aab01e3524
10 changed files with 65 additions and 21 deletions
|
@ -844,6 +844,10 @@ class AST_Tests(unittest.TestCase):
|
|||
check_limit("a", "[0]")
|
||||
check_limit("a", "*a")
|
||||
|
||||
def test_null_bytes(self):
|
||||
with self.assertRaises(SyntaxError,
|
||||
msg="source code string cannot contain null bytes"):
|
||||
ast.parse("a\0b")
|
||||
|
||||
class ASTHelpers_Test(unittest.TestCase):
|
||||
maxDiff = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue