summaryrefslogtreecommitdiff
path: root/coverage/phystokens.py
diff options
context:
space:
mode:
authorMax Linke <max_linke@gmx.de>2015-12-14 11:27:12 +0100
committerMax Linke <max_linke@gmx.de>2015-12-14 11:27:12 +0100
commit01ff52eba403dcfbd14c742ce1106931756469af (patch)
tree28132a01d46223212d146fb3bc69d3fd087b1690 /coverage/phystokens.py
parentae91d45616dbc4dddcd66955b41ffb5fa420ddda (diff)
downloadpython-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.
Diffstat (limited to 'coverage/phystokens.py')
-rw-r--r--coverage/phystokens.py2
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