Skip to content

Commit

Permalink
CLDR import: assume files without revision tags to be new
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Dec 31, 2019
1 parent fa159ab commit 7210705
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/import_cldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ def error(message, *args):
def need_conversion(dst_filename, data_dict, source_filename):
with open(source_filename, 'rb') as f:
blob = f.read(4096)
version = int(re.search(b'version number="\\$Revision: (\\d+)',
blob).group(1))
version_match = re.search(b'version number="\\$Revision: (\\d+)', blob)
if not version_match: # CLDR 36.0 was shipped without proper revision numbers
return True
version = int(version_match.group(1))

data_dict['_version'] = version
if not os.path.isfile(dst_filename):
Expand Down

0 comments on commit 7210705

Please sign in to comment.