diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-28 07:50:55 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-28 07:50:55 -0500 |
commit | 39f905fc1d78c65df715f8617246bc948fceb468 (patch) | |
tree | 834b20907800b6eedb79629fa4620a94a75b4d95 /coverage/phystokens.py | |
parent | 063df33ffd82100910076600961057aba91da2fa (diff) | |
download | python-coveragepy-39f905fc1d78c65df715f8617246bc948fceb468.tar.gz |
Fix bug with \f in HTML report. #360.
Diffstat (limited to 'coverage/phystokens.py')
-rw-r--r-- | coverage/phystokens.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/coverage/phystokens.py b/coverage/phystokens.py index b3b0870..ed6bd23 100644 --- a/coverage/phystokens.py +++ b/coverage/phystokens.py @@ -85,8 +85,11 @@ def source_token_lines(source): ws_tokens = set([token.INDENT, token.DEDENT, token.NEWLINE, tokenize.NL]) line = [] col = 0 - source = source.expandtabs(8).replace('\r\n', '\n') + + # The \f is because of http://bugs.python.org/issue19035 + source = source.expandtabs(8).replace('\r\n', '\n').replace('\f', ' ') tokgen = generate_tokens(source) + for ttype, ttext, (_, scol), (_, ecol), _ in phys_tokens(tokgen): mark_start = True for part in re.split('(\n)', ttext): |