[pypy-svn] r29797 - in pypy/branch/objspace-config-cleanup/pypy/config: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Sat Jul 8 12:10:40 CEST 2006


Author: cfbolz
Date: Sat Jul  8 12:10:37 2006
New Revision: 29797

Modified:
   pypy/branch/objspace-config-cleanup/pypy/config/config.py
   pypy/branch/objspace-config-cleanup/pypy/config/test/test_config.py
Log:
make freezing twice possible


Modified: pypy/branch/objspace-config-cleanup/pypy/config/config.py
==============================================================================
--- pypy/branch/objspace-config-cleanup/pypy/config/config.py	(original)
+++ pypy/branch/objspace-config-cleanup/pypy/config/config.py	Sat Jul  8 12:10:37 2006
@@ -23,7 +23,8 @@
             elif isinstance(child, OptionDescription):
                 self.__dict__[child._name] = Config(child)
         for name, value in overrides.iteritems():
-            setattr(self, name, value)
+            subconfig, name = self._get_by_path(name)
+            setattr(subconfig, name, value)
 
     def __setattr__(self, name, value):
         if self._frozen:
@@ -58,7 +59,7 @@
         return self, path[-1]
 
     def _freeze_(self):
-        self._frozen = True
+        self.__dict__['_frozen'] = True
         return True
 
     def getkey(self):

Modified: pypy/branch/objspace-config-cleanup/pypy/config/test/test_config.py
==============================================================================
--- pypy/branch/objspace-config-cleanup/pypy/config/test/test_config.py	(original)
+++ pypy/branch/objspace-config-cleanup/pypy/config/test/test_config.py	Sat Jul  8 12:10:37 2006
@@ -77,7 +77,7 @@
     assert len(block.exits) == 1
     assert block.operations[0].opname == 'int_add'
 
-    # the config should be frozen now
+    assert config._freeze_()
     py.test.raises(TypeError, 'config.gc.name = "framework"')
 
 def test_compare_configs():



More information about the Pypy-commit mailing list