summaryrefslogtreecommitdiff
path: root/coverage/parser.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-10-25 17:40:09 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-10-25 17:40:09 -0400
commitb810cbc0d06df0a04e3380166215b8ad2f40524c (patch)
treeb0ea1499815b84301fa7991e37de128265526e81 /coverage/parser.py
parent15100248c12b85a00278371fea60f07718a9d499 (diff)
downloadpython-coveragepy-git-b810cbc0d06df0a04e3380166215b8ad2f40524c.tar.gz
Properly handle filenames with non-ASCII characters. #432
Diffstat (limited to 'coverage/parser.py')
-rw-r--r--coverage/parser.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index 882c972b..a5e96237 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -211,7 +211,7 @@ class PythonParser(object):
else:
lineno = err.args[1][0] # TokenError
raise NotPython(
- "Couldn't parse '%s' as Python source: '%s' at line %d" % (
+ u"Couldn't parse '%s' as Python source: '%s' at line %d" % (
self.filename, err.args[0], lineno
)
)
@@ -338,7 +338,7 @@ class ByteParser(object):
self.code = compile_unicode(text, filename, "exec")
except SyntaxError as synerr:
raise NotPython(
- "Couldn't parse '%s' as Python source: '%s' at line %d" % (
+ u"Couldn't parse '%s' as Python source: '%s' at line %d" % (
filename, synerr.msg, synerr.lineno
)
)