From e431d3c9aadb52dd1eea4d1e606e94f1c8471459 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 20 Mar 2016 23:36:29 +0200 Subject: Issue #26581: Use the first coding cookie on a line, not the last one. --- Tools/scripts/findnocoding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Tools/scripts/findnocoding.py') 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): -- cgit v1.2.1