From 6055667e8090fc09e55b96ae49d5ac6a37706ede Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 12 Dec 2014 08:51:19 -0500 Subject: Source is always Unicode in HTML code. More refactoring to come. --- coverage/phystokens.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'coverage/phystokens.py') diff --git a/coverage/phystokens.py b/coverage/phystokens.py index fe77c7de..3fd1165c 100644 --- a/coverage/phystokens.py +++ b/coverage/phystokens.py @@ -1,6 +1,7 @@ """Better tokenizing for coverage.py.""" import codecs, keyword, re, sys, token, tokenize + from coverage.parser import generate_tokens @@ -75,6 +76,7 @@ def source_token_lines(source): is indistinguishable from a final line with a newline. """ + ws_tokens = set([token.INDENT, token.DEDENT, token.NEWLINE, tokenize.NL]) line = [] col = 0 @@ -108,6 +110,7 @@ def source_token_lines(source): if line: yield line + def source_encoding(source): """Determine the encoding for `source` (a string), according to PEP 263. -- cgit v1.2.1