mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #26581: Use the first coding cookie on a line, not the last one.
This commit is contained in:
parent
97eee1cfda
commit
e431d3c9aa
8 changed files with 10 additions and 6 deletions
|
@ -32,7 +32,7 @@ except ImportError:
|
|||
"no sophisticated Python source file search will be done.", file=sys.stderr)
|
||||
|
||||
|
||||
decl_re = re.compile(rb'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)')
|
||||
decl_re = re.compile(rb'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)')
|
||||
blank_re = re.compile(rb'^[ \t\f]*(?:[#\r\n]|$)')
|
||||
|
||||
def get_declaration(line):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue