From 15100248c12b85a00278371fea60f07718a9d499 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 16 Oct 2015 22:26:44 -0400 Subject: Tweak neuter_encoding_declaration --- coverage/phystokens.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/coverage/phystokens.py b/coverage/phystokens.py index 5d2ccfc7..203d41f2 100644 --- a/coverage/phystokens.py +++ b/coverage/phystokens.py @@ -287,11 +287,6 @@ def compile_unicode(source, filename, mode): @contract(source='unicode', returns='unicode') def neuter_encoding_declaration(source): - """Return `source`, with any encoding declaration neutered. - - This function will only ever be called on `source` that has an encoding - declaration, so some edge cases can be ignored. - - """ - source = COOKIE_RE.sub("# (deleted declaration)", source) + """Return `source`, with any encoding declaration neutered.""" + source = COOKIE_RE.sub("# (deleted declaration)", source, count=1) return source -- cgit v1.2.1