From 8d3a176d4f60b658f1dca26ba5b2bcd3194dc2e2 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Thu, 5 May 2016 23:53:32 +0000 Subject: [PATCH] ICU-12526 ignore inline comments in script metadata X-SVN-Rev: 38709 --- tools/unicode/py/parsescriptmetadata.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/unicode/py/parsescriptmetadata.py b/tools/unicode/py/parsescriptmetadata.py index 46823ba2d6a..c971e3c86df 100755 --- a/tools/unicode/py/parsescriptmetadata.py +++ b/tools/unicode/py/parsescriptmetadata.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright (c) 2013 International Business Machines +# Copyright (c) 2013-2016 International Business Machines # Corporation and others. All Rights Reserved. # # parsescriptmetadata.py @@ -49,9 +49,10 @@ def main(): # and put the data (as strings) into the icu_data list. with open(smd_path, "r") as smd_file: for line in smd_file: + comment_start = line.find("#") + if comment_start >= 0: line = line[0:comment_start] line = line.strip() if not line: continue - if line.startswith("#"): continue # whole-line comment fields = line.split(";") if not fields or len(fields) < 11: continue -- 2.40.0