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

arigo at codespeak.net arigo at codespeak.net
Fri Jun 4 16:33:04 CEST 2004


Author: arigo
Date: Fri Jun  4 16:33:04 2004
New Revision: 4912

Modified:
   pypy/branch/src-newobjectmodel/pypy/interpreter/typedef.py
   pypy/branch/src-newobjectmodel/pypy/objspace/trivial.py
Log:
attrproperty fix.


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	Fri Jun  4 16:33:04 2004
@@ -35,13 +35,13 @@
 
 def attrproperty(name):
     def fget(space, w_obj):
-        obj = space.unwrap(w_obj)
+        obj = space.unwrap_builtin(w_obj)
         return space.wrap(getattr(obj, name))
     return GetSetProperty(fget)
 
 def attrproperty_w(name):
     def fget(space, w_obj):
-        obj = space.unwrap(w_obj)
+        obj = space.unwrap_builtin(w_obj)
         w_value = getattr(obj, name)
         if w_value is None:
             return space.w_None

Modified: pypy/branch/src-newobjectmodel/pypy/objspace/trivial.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/objspace/trivial.py	(original)
+++ pypy/branch/src-newobjectmodel/pypy/objspace/trivial.py	Fri Jun  4 16:33:04 2004
@@ -144,6 +144,8 @@
         else:
             return w
 
+    unwrap_builtin = unwrap
+
     def hackwrapperclass(self, typedef):
         try:
             return typedef.trivialwrapperclass
@@ -191,12 +193,6 @@
             typedef.trivialwrapperclass = cls
             return cls
 
-    def unwrap_builtin(self, w_obj):
-        if isinstance(w_obj, CPyWrapper):
-            return self.unwrap(w_obj)
-        else:
-            return None
-
     def is_(self, w_obj1, w_obj2):
         return self.unwrap(w_obj1) is self.unwrap(w_obj2)
 



More information about the Pypy-commit mailing list