[pypy-svn] r4865 - in pypy/branch/src-newobjectmodel/pypy: interpreter objspace

hpk at codespeak.net hpk at codespeak.net
Thu Jun 3 15:42:49 CEST 2004


Author: hpk
Date: Thu Jun  3 15:42:49 2004
New Revision: 4865

Modified:
   pypy/branch/src-newobjectmodel/pypy/interpreter/eval.py
   pypy/branch/src-newobjectmodel/pypy/interpreter/typedef.py
   pypy/branch/src-newobjectmodel/pypy/objspace/descroperation.py
Log:
- add f_locals 
- fix delattr to raise attrerror  correctly


Modified: pypy/branch/src-newobjectmodel/pypy/interpreter/eval.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/interpreter/eval.py	(original)
+++ pypy/branch/src-newobjectmodel/pypy/interpreter/eval.py	Thu Jun  3 15:42:49 2004
@@ -82,6 +82,9 @@
         self.fast2locals()
         return self.w_locals
 
+    def fget_getdictscope(space, self):
+        return self.getdictscope()
+
     def setdictscope(self, w_locals):
         "Initialize the locals from a dictionary."
         self.w_locals = w_locals

Modified: pypy/branch/src-newobjectmodel/pypy/interpreter/typedef.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/interpreter/typedef.py	(original)
+++ pypy/branch/src-newobjectmodel/pypy/interpreter/typedef.py	Thu Jun  3 15:42:49 2004
@@ -63,7 +63,8 @@
 
 Frame.typedef = TypeDef('internal-frame',
     f_code = attrproperty('code'),
-    #f_locals = GetSetProperty(getdictscope, setdictscope), XXX
+    f_locals = GetSetProperty(Frame.fget_getdictscope.im_func,
+                              ), # , setdictscope), XXX
     f_globals = attrproperty_w('w_globals'),
     )
 

Modified: pypy/branch/src-newobjectmodel/pypy/objspace/descroperation.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/objspace/descroperation.py	(original)
+++ pypy/branch/src-newobjectmodel/pypy/objspace/descroperation.py	Thu Jun  3 15:42:49 2004
@@ -40,7 +40,11 @@
                 return space.delete(w_descr,w_obj)
         w_dict = space.getdict(w_obj)
         if w_dict is not None:
-            return space.delitem(w_dict,w_name)
+            try:
+                return space.delitem(w_dict,w_name)
+            except OperationError, ex:
+                if not ex.match(space, space.w_KeyError):
+                    raise
         raise OperationError(space.w_AttributeError,w_name)
 
     def descr__init__(space, w_obj, *args_w, **kwds_w):



More information about the Pypy-commit mailing list