We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 506f464 commit 8f3381cCopy full SHA for 8f3381c
mypy/test/data/parse-errors.test
@@ -481,6 +481,14 @@ file:2: error: Unknown encoding 'uft8'
481
[out]
482
file:4: error: Unrecognized character
483
484
+[case testDoubleEncoding4]
485
+
486
487
+# coding: ascii
488
+á = 1
489
+[out]
490
+file:4: error: Unrecognized character
491
492
[case testLongLiteralInPython3]
493
2L
494
0x2L
mypy/util.py
@@ -7,7 +7,7 @@
7
8
T = TypeVar('T')
9
10
-ENCODING_RE = re.compile(br'(\s*#.*(\r\n?|\n)){0,1}?\s*#.*coding[:=]\s*([-\w.]+)')
+ENCODING_RE = re.compile(br'([ \t\v]*#.*(\r\n?|\n))??[ \t\v]*#.*coding[:=][ \t]*([-\w.]+)')
11
12
default_python2_interpreter = ['python2', 'python', '/usr/bin/python']
13
0 commit comments