diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-05 14:48:41 -0500 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-05 14:48:41 -0500 |
| commit | 3e2625dd17674339073c6afc4da6ba3b99932e4c (patch) | |
| tree | a33fc165730c677dc719c2b141e9712996f59555 /coverage | |
| parent | a3b1ce5cdad7b61ac667a80fdff7b7928310ed45 (diff) | |
| download | python-coveragepy-3e2625dd17674339073c6afc4da6ba3b99932e4c.tar.gz | |
Fix another form-feed problem, #461
Diffstat (limited to 'coverage')
| -rw-r--r-- | coverage/phystokens.py | 3 | ||||
| -rw-r--r-- | coverage/python.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/coverage/phystokens.py b/coverage/phystokens.py index 5aa3402..5e80ed5 100644 --- a/coverage/phystokens.py +++ b/coverage/phystokens.py @@ -92,8 +92,7 @@ def source_token_lines(source): line = [] col = 0 - # The \f is because of http://bugs.python.org/issue19035 - source = source.expandtabs(8).replace('\r\n', '\n').replace('\f', ' ') + source = source.expandtabs(8).replace('\r\n', '\n') tokgen = generate_tokens(source) for ttype, ttext, (_, scol), (_, ecol), _ in phys_tokens(tokgen): diff --git a/coverage/python.py b/coverage/python.py index 5e56382..07d2347 100644 --- a/coverage/python.py +++ b/coverage/python.py @@ -50,6 +50,8 @@ def get_python_source(filename): # Couldn't find source. raise NoSource("No source for code: '%s'." % filename) + # Replace \f because of http://bugs.python.org/issue19035 + source = source.replace(b'\f', b' ') source = source.decode(source_encoding(source), "replace") # Python code should always end with a line with a newline. |
