1. Georg Brandl
  2. pygments-main

Commits

thatch  committed 56c3e7e

check_sources should be unicode-aware when checking copyright info

  • Participants
  • Parent commits 78ffe80
  • Branches trunk

Comments (0)

Files changed (1)

File scripts/check_sources.py

View file
  • Ignore whitespace
 
 name_mail_re = r'[\w ]+(<.*?>)?'
 copyright_re = re.compile(r'^    :copyright: 200\d(-200\d)? by %s(, %s)*[,.]$' %
-                          (name_mail_re, name_mail_re))
+                          (name_mail_re, name_mail_re), re.UNICODE)
 copyright_2_re = re.compile(r'^                %s(, %s)*[,.]$' %
-                            (name_mail_re, name_mail_re))
+                            (name_mail_re, name_mail_re), re.UNICODE)
 coding_re    = re.compile(r'coding[:=]\s*([-\w.]+)')
 not_ix_re    = re.compile(r'\bnot\s+\S+?\s+i[sn]\s\S+')
 is_const_re  = re.compile(r'if.*?==\s+(None|False|True)\b')
         yield 0, "no correct license info"
 
     ci = -3
-    copyright = llist[ci:ci+1]
+    copyright = [s.decode('utf-8') for s in llist[ci:ci+1]]
     while copyright and copyright_2_re.match(copyright[0]):
         ci -= 1
         copyright = llist[ci:ci+1]