Remove the line_offset calculation. We can now also remove it from tokenize. With the position_modifier we have enough tools to change a position, we don't need to do that in tokenize.py.

This commit is contained in:
Dave Halter
2015-01-29 17:57:01 +01:00
parent a3cdec819e
commit 413da3b790
3 changed files with 32 additions and 12 deletions

View File

@@ -180,6 +180,20 @@ def test_nested_funcs():
check_fp(src, 3)
def test_func_with_for_and_comment():
# The first newline is important, leave it.
src = dedent("""\
def func():
pass
for a in [1]:
# COMMENT
a""")
check_fp(src, 2, 3)
check_fp('a\n' + src, 1, 3)
def test_incomplete_function():
source = '''return ImportErr'''