[pypy-svn] r36602 - in pypy/dist/pypy/config: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Fri Jan 12 18:34:59 CET 2007


Author: cfbolz
Date: Fri Jan 12 18:34:53 2007
New Revision: 36602

Modified:
   pypy/dist/pypy/config/config.py
   pypy/dist/pypy/config/test/test_config.py
Log:
test + fix


Modified: pypy/dist/pypy/config/config.py
==============================================================================
--- pypy/dist/pypy/config/config.py	(original)
+++ pypy/dist/pypy/config/config.py	Fri Jan 12 18:34:53 2007
@@ -80,7 +80,7 @@
         oldowner = self._cfgimpl_value_owners[child._name]
         oldvalue = getattr(self, name)
         if oldvalue != value and oldowner not in ("default", "suggested"):
-            if who == "default":
+            if who in ("default", "suggested"):
                 return
             raise ValueError('cannot override value %s for option %s' %
                                 (value, name))

Modified: pypy/dist/pypy/config/test/test_config.py
==============================================================================
--- pypy/dist/pypy/config/test/test_config.py	(original)
+++ pypy/dist/pypy/config/test/test_config.py	Fri Jan 12 18:34:53 2007
@@ -459,3 +459,12 @@
     # does not crash
     c.toplevel = False
     assert not c.toplevel
+
+    c = Config(descr)
+    c.toplevel = False
+    assert not c.toplevel
+    # does not crash
+    c.opt = True
+    assert c.opt
+    assert not c.toplevel
+



More information about the Pypy-commit mailing list