Commits

holger krekel committed 66749bc

transfer latest iniconfig change

Comments (0)

Files changed (2)

             return line[1:-1], None
         # value
         elif not line[0].isspace():
-            i = line.find(": ")
-            if i != -1:
-                name, value = line.split(": ", 1)
-            else:
+            try:
+                name, value = line.split('=', 1)
+                if ": " in name:
+                    raise ValueError()
+            except ValueError:
                 try:
-                    name, value = line.split('=', 1)
+                    name, value = line.split(": ", 1)
                 except ValueError:
                     self._raise(lineno, 'unexpected line: %s')
             return name.strip(), value.strip()

testing/test_iniconfig.py

         'value:xyz=5',
         [(0, None, 'value:xyz', '5')]
     ),
+    'equality gets precedence': (
+        'value=xyz:5',
+        [(0, None, 'value', 'xyz:5')]
+    ),
 
 }