Fix strange python 3 incompatibilities.
authorCarl Hetherington <cth@carlh.net>
Fri, 18 Jun 2021 18:00:49 +0000 (20:00 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 18 Jun 2021 18:00:49 +0000 (20:00 +0200)
scripts/update-language-subtags

index 3ea53572ca1b175fd1e738a26ea78e9a28c61d78..20db5219cf5d80bdc473e174e0425cd0559d572e 100755 (executable)
@@ -10,7 +10,7 @@ lists = {}
 with urllib.request.urlopen('https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry') as f:
 #with open('language-subtag-registry', 'r') as f:
     for l in f.readlines():
-        if l.strip().decode('utf-8') == "%%":
+        if l.strip() == "%%":
             if 'Type' in block:
                 if block['Type'] in ['language', 'variant', 'region', 'script', 'extlang']:
                     if not block['Type'] in lists:
@@ -23,7 +23,7 @@ with urllib.request.urlopen('https://www.iana.org/assignments/language-subtag-re
                     print("Unknown type `%s'" % block['Type'])
             block = {}
         else:
-            p = l.strip().decode('utf-8').split(':')
+            p = l.strip().split(':')
             if len(p) > 1:
                 key = p[0]
                 value = p[1][1:]