]> Savannah Git Hosting - gnulib.git/commitdiff
module: use list on line-by-line iteration
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 28 Sep 2017 07:05:15 +0000 (10:05 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Thu, 28 Sep 2017 07:05:15 +0000 (10:05 +0300)
pygnulib/module.py

index ec71a1f9bdf74a518c091f543170904b52e1cb14..3bce3a13020bcc7242487259ace7c7608eecd6ff 100644 (file)
@@ -410,12 +410,12 @@ class File(Base):
                 match = File._PATTERN_.split(stream.read())[1:]
             for (group, value) in zip(match[::2], match[1::2]):
                 (typeid, key) = File._TABLE_[group]
-                if typeid is set:
-                    lines = set()
+                if typeid is (list, set, tuple):
+                    lines = []
                     for line in value.splitlines():
                         if not line.strip() or line.startswith("#"):
                             continue
-                        lines.add(line)
+                        lines += [line]
                     table[key] = lines
                 else:
                     table[key] = value.strip()