summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-03-20 21:36:29 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-03-20 21:36:29 (GMT)
commit6d297cbec48e9026ddf31d2ff95df7c182572dc9 (patch)
tree77e0dd82cbcfa6c48fffeeb24f6c31ec62510bfa /Tools/scripts
parentcac1d236a24e2755c05103d485a3b42a884b5a45 (diff)
downloadcpython-6d297cbec48e9026ddf31d2ff95df7c182572dc9.zip
cpython-6d297cbec48e9026ddf31d2ff95df7c182572dc9.tar.gz
cpython-6d297cbec48e9026ddf31d2ff95df7c182572dc9.tar.bz2
Issue #26581: Use the first coding cookie on a line, not the last one.
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-xTools/scripts/findnocoding.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Tools/scripts/findnocoding.py b/Tools/scripts/findnocoding.py
index 70b1a66..79ea7e5 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.")
-decl_re = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)')
+decl_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)')
blank_re = re.compile(r'^[ \t\f]*(?:[#\r\n]|$)')
def get_declaration(line):