[pypy-svn] r71564 - pypy/trunk/pypy/objspace/std

benjamin at codespeak.net benjamin at codespeak.net
Sun Feb 28 20:09:53 CET 2010


Author: benjamin
Date: Sun Feb 28 20:09:52 2010
New Revision: 71564

Modified:
   pypy/trunk/pypy/objspace/std/objspace.py
Log:
avoid looking __get__ up two times

Modified: pypy/trunk/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/objspace.py	(original)
+++ pypy/trunk/pypy/objspace/std/objspace.py	Sun Feb 28 20:09:52 2010
@@ -638,13 +638,15 @@
         e = None
         if w_descr is not None:
             w_get = None
-            if self.is_data_descr(w_descr):
+            is_data = self.is_data_descr(w_descr)
+            if is_data:
                 w_get = self.lookup(w_descr, "__get__")
             if w_get is None:
                 w_value = w_obj.getdictvalue_attr_is_in_class(self, name)
                 if w_value is not None:
                     return w_value
-                w_get = self.lookup(w_descr, "__get__")
+                if not is_data:
+                    w_get = self.lookup(w_descr, "__get__")
             if w_get is not None:
                 # __get__ is allowed to raise an AttributeError to trigger
                 # use of __getattr__.



More information about the Pypy-commit mailing list