diff options
author | Max Linke <max_linke@gmx.de> | 2015-12-14 11:27:12 +0100 |
---|---|---|
committer | Max Linke <max_linke@gmx.de> | 2015-12-14 11:27:12 +0100 |
commit | 01ff52eba403dcfbd14c742ce1106931756469af (patch) | |
tree | 28132a01d46223212d146fb3bc69d3fd087b1690 | |
parent | ae91d45616dbc4dddcd66955b41ffb5fa420ddda (diff) | |
download | python-coveragepy-git-01ff52eba403dcfbd14c742ce1106931756469af.tar.gz |
Fix error with double occurence of encoding declaration
If a file sets the encoding using both vim and emacs style we can't
compile the source-code. This commit ensures that always both
occurences are removed before we compile the source-code.
-rw-r--r-- | coverage/phystokens.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/coverage/phystokens.py b/coverage/phystokens.py index b34b1c3b..5aa3402c 100644 --- a/coverage/phystokens.py +++ b/coverage/phystokens.py @@ -291,5 +291,5 @@ def compile_unicode(source, filename, mode): @contract(source='unicode', returns='unicode') def neuter_encoding_declaration(source): """Return `source`, with any encoding declaration neutered.""" - source = COOKIE_RE.sub("# (deleted declaration)", source, count=1) + source = COOKIE_RE.sub("# (deleted declaration)", source, count=2) return source |