]> granicus.if.org Git - icu/commitdiff
ICU-12526 ignore inline comments in script metadata
authorMarkus Scherer <markus.icu@gmail.com>
Thu, 5 May 2016 23:53:32 +0000 (23:53 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Thu, 5 May 2016 23:53:32 +0000 (23:53 +0000)
X-SVN-Rev: 38709

tools/unicode/py/parsescriptmetadata.py

index 46823ba2d6a04c77e0e91f18c74b4219263fcf9a..c971e3c86df17cb0c18baeab6a0788132bf561cf 100755 (executable)
@@ -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