From f7ca62f80d91f4f207a0b9f5675aa251be3dfff1 Mon Sep 17 00:00:00 2001 From: Max Linke Date: Mon, 14 Dec 2015 11:27:12 +0100 Subject: 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. --- coverage/phystokens.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coverage/phystokens.py') diff --git a/coverage/phystokens.py b/coverage/phystokens.py index b34b1c3..5aa3402 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 -- cgit v1.2.1