diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-10-16 22:26:44 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-10-16 22:26:44 -0400 |
commit | 15100248c12b85a00278371fea60f07718a9d499 (patch) | |
tree | a5cc0ce15a9a700364130585a90755792f5985e6 /coverage/phystokens.py | |
parent | ece5793c816cfb6c5fc41581b6aa91c471d42f5b (diff) | |
download | python-coveragepy-git-15100248c12b85a00278371fea60f07718a9d499.tar.gz |
Tweak neuter_encoding_declaration
Diffstat (limited to 'coverage/phystokens.py')
-rw-r--r-- | coverage/phystokens.py | 9 |
1 files 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 |