diff options
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index d7c536e..d113a00 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -161,7 +161,7 @@ if 1: co = compile(s256, 'fn', 'exec') self.assertEqual(co.co_firstlineno, 1) lines = list(co.co_lines()) - self.assertEqual(lines[0][2], None) + self.assertEqual(lines[0][2], 0) self.assertEqual(lines[1][2], 257) def test_literals_with_leading_zeroes(self): @@ -1054,6 +1054,8 @@ class TestSourcePositions(unittest.TestCase): # Check against the positions in the code object. for (line, end_line, col, end_col) in code.co_positions(): + if line == 0: + continue # This is an artificial module-start line # If the offset is not None (indicating missing data), ensure that # it was part of one of the AST nodes. if line is not None: |