the encoding directive must be a comment
This commit is contained in:
parent
8c6fe8681b
commit
bd8c52d8d2
@ -78,7 +78,7 @@ def lookup_module(filename):
|
||||
# stolen from Python 3.1's tokenize.py, by Ka-Ping Yee
|
||||
|
||||
import re
|
||||
cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
|
||||
cookie_re = re.compile("^\s*#.*coding[:=]\s*([-\w.]+)")
|
||||
from codecs import lookup, BOM_UTF8
|
||||
|
||||
def detect_encoding(readline):
|
||||
|
5
test/test-encoding.py
Normal file
5
test/test-encoding.py
Normal file
@ -0,0 +1,5 @@
|
||||
def f(encoding=None):
|
||||
print 'ENCODING:', encoding
|
||||
|
||||
from pudb import runcall
|
||||
runcall(f)
|
Loading…
Reference in New Issue
Block a user