Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r54982:b1a9d9b534aa
Date: 2012-05-09 09:45 +0200
http://bitbucket.org/pypy/pypy/changeset/b1a9d9b534aa/

Log:    Test and fix.

diff --git a/pypy/config/parse.py b/pypy/config/parse.py
--- a/pypy/config/parse.py
+++ b/pypy/config/parse.py
@@ -4,8 +4,8 @@
     """See test_parse.py."""
     text = text.lstrip()
     result = {}
-    if text.startswith('['):
-        # new format
+    if (text+':').index(':') > (text+'=').index('='):
+        # found a '=' before a ':' means that we have the new format
         current = {0: ''}
         indentation_prefix = None
         for line in text.splitlines():
diff --git a/pypy/config/test/test_parse.py b/pypy/config/test/test_parse.py
--- a/pypy/config/test/test_parse.py
+++ b/pypy/config/test/test_parse.py
@@ -20,6 +20,9 @@
         'objspace.x': 'hello',
         })
 
+    assert parse_info("simple = 43\n") == {'simple': 43}
+
+
 def test_parse_old_format():
     assert (parse_info("                          objspace.allworkingmodules: 
True\n"
                        "                    objspace.disable_call_speedhacks: 
False\n"
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to