diff options
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index c97d161..9a7df28 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -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 |