diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-20 23:47:48 +0200 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-20 23:47:48 +0200 |
| commit | a051bf3afbb30b7ddb7bd4c7ba03acc63288d6f2 (patch) | |
| tree | 8d2fe8a1e6edbbae0ae6b0dd193a38d4033ef9fd /Tools | |
| parent | fc6990d3824340dd86f085250aac37267d57194f (diff) | |
| parent | e431d3c9aadb52dd1eea4d1e606e94f1c8471459 (diff) | |
| download | cpython-git-a051bf3afbb30b7ddb7bd4c7ba03acc63288d6f2.tar.gz | |
Issue #26581: Use the first coding cookie on a line, not the last one.
Diffstat (limited to 'Tools')
| -rwxr-xr-x | Tools/scripts/findnocoding.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Tools/scripts/findnocoding.py b/Tools/scripts/findnocoding.py index 5f3795e657..6c16b1ce15 100755 --- a/Tools/scripts/findnocoding.py +++ b/Tools/scripts/findnocoding.py @@ -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): |
