mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.11] gh-96670: Raise SyntaxError when parsing NULL bytes (GH-97594) (#104195)
This commit is contained in:
parent
c5dafeaa6d
commit
a09d3901a5
9 changed files with 77 additions and 22 deletions
|
@ -857,6 +857,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