summaryrefslogtreecommitdiff
path: root/coverage/phystokens.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/phystokens.py')
-rw-r--r--coverage/phystokens.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/coverage/phystokens.py b/coverage/phystokens.py
index df569fc..9281a44 100644
--- a/coverage/phystokens.py
+++ b/coverage/phystokens.py
@@ -122,7 +122,7 @@ def source_encoding(source):
cookie_re = re.compile(r"coding[:=]\s*([-\w.]+)")
# Do this so the detect_encode code we copied will work.
- readline = iter(source.splitlines()).next
+ readline = iter(source.splitlines(True)).next
def _get_normal_name(orig_enc):
"""Imitates get_normal_name in tokenizer.c."""
@@ -188,7 +188,7 @@ def source_encoding(source):
bom_found = True
first = first[3:]
default = 'utf-8-sig'
- if first is None:
+ if not first:
return default
encoding = find_cookie(first)