[pypy-svn] r12341 - pypy/dist/pypy/objspace/std

pedronis at codespeak.net pedronis at codespeak.net
Mon May 16 02:39:50 CEST 2005


Author: pedronis
Date: Mon May 16 02:39:50 2005
New Revision: 12341

Modified:
   pypy/dist/pypy/objspace/std/typeobject.py
Log:
reintroudeced delattr to fix del D.__hash__ kind of manipulations



Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/typeobject.py	Mon May 16 02:39:50 2005
@@ -333,6 +333,21 @@
             return
     w_type.dict_w[name] = w_value
 
+def delattr__Type_ANY(space, w_type, w_name):
+    if w_type.lazyloaders:
+        w_type._freeze_()    # force un-lazification
+    name = space.str_w(w_name)
+    w_descr = space.lookup(w_type, name)
+    if w_descr is not None:
+        if space.is_data_descr(w_descr):
+            space.delete(w_descr, w_type)
+            return
+    try:
+        del w_type.dict_w[name]
+        return
+    except KeyError:
+        raise OperationError(space.w_AttributeError, w_name)
+
 # ____________________________________________________________
 
 



More information about the Pypy-commit mailing list