Extended the search for a 'coding' statement from the first two lines to the first 5 lines because some scripts include empty lines between the she-bang line and the coding line.

Sun, 21 Jan 2018 12:34:07 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 21 Jan 2018 12:34:07 +0100
changeset 6075
281a47a8be9d
parent 6074
c44902c128ea
child 6076
b784925fb174

Extended the search for a 'coding' statement from the first two lines to the first 5 lines because some scripts include empty lines between the she-bang line and the coding line.

Utilities/__init__.py file | annotate | diff | comparison | revisions
--- a/Utilities/__init__.py	Sun Jan 21 12:32:31 2018 +0100
+++ b/Utilities/__init__.py	Sun Jan 21 12:34:07 2018 +0100
@@ -81,11 +81,11 @@
 configDir = None
 
 codingBytes_regexps = [
-    (2, re.compile(br'''coding[:=]\s*([-\w_.]+)''')),
+    (5, re.compile(br'''coding[:=]\s*([-\w_.]+)''')),
     (1, re.compile(br'''<\?xml.*\bencoding\s*=\s*['"]([-\w_.]+)['"]\?>''')),
 ]
 coding_regexps = [
-    (2, re.compile(r'''coding[:=]\s*([-\w_.]+)''')),
+    (5, re.compile(r'''coding[:=]\s*([-\w_.]+)''')),
     (1, re.compile(r'''<\?xml.*\bencoding\s*=\s*['"]([-\w_.]+)['"]\?>''')),
 ]
 

eric ide

mercurial