[pypy-svn] r73405 - in pypy/trunk/pypy/annotation: . test

benjamin at codespeak.net benjamin at codespeak.net
Mon Apr 5 04:50:49 CEST 2010


Author: benjamin
Date: Mon Apr  5 04:50:46 2010
New Revision: 73405

Modified:
   pypy/trunk/pypy/annotation/bookkeeper.py
   pypy/trunk/pypy/annotation/description.py
   pypy/trunk/pypy/annotation/test/test_annrpython.py
Log:
revert r73347, which is causing bz2 failures for some reason

Modified: pypy/trunk/pypy/annotation/bookkeeper.py
==============================================================================
--- pypy/trunk/pypy/annotation/bookkeeper.py	(original)
+++ pypy/trunk/pypy/annotation/bookkeeper.py	Mon Apr  5 04:50:46 2010
@@ -523,7 +523,7 @@
                         self.getdesc(pyobj.im_func),            # funcdesc
                         self.getuniqueclassdef(origincls),      # originclassdef
                         classdef,                               # selfclassdef
-                        name, pyobj=pyobj)
+                        name)
             else:
                 # must be a frozen pre-built constant, but let's check
                 try:
@@ -552,7 +552,7 @@
         return result
 
     def getmethoddesc(self, funcdesc, originclassdef, selfclassdef, name,
-                      flags={}, pyobj=None):
+                      flags={}):
         flagskey = flags.items()
         flagskey.sort()
         key = funcdesc, originclassdef, selfclassdef, name, tuple(flagskey)
@@ -560,7 +560,7 @@
             return self.methoddescs[key]
         except KeyError:
             result = description.MethodDesc(self, funcdesc, originclassdef,
-                                            selfclassdef, name, flags, pyobj)
+                                            selfclassdef, name, flags)
             self.methoddescs[key] = result
             return result
 

Modified: pypy/trunk/pypy/annotation/description.py
==============================================================================
--- pypy/trunk/pypy/annotation/description.py	(original)
+++ pypy/trunk/pypy/annotation/description.py	Mon Apr  5 04:50:46 2010
@@ -689,8 +689,8 @@
     knowntype = types.MethodType
 
     def __init__(self, bookkeeper, funcdesc, originclassdef, 
-                 selfclassdef, name, flags={}, pyobj=None):
-        super(MethodDesc, self).__init__(bookkeeper, pyobj)
+                 selfclassdef, name, flags={}):
+        super(MethodDesc, self).__init__(bookkeeper)
         self.funcdesc = funcdesc
         self.originclassdef = originclassdef
         self.selfclassdef = selfclassdef

Modified: pypy/trunk/pypy/annotation/test/test_annrpython.py
==============================================================================
--- pypy/trunk/pypy/annotation/test/test_annrpython.py	(original)
+++ pypy/trunk/pypy/annotation/test/test_annrpython.py	Mon Apr  5 04:50:46 2010
@@ -1751,23 +1751,6 @@
         s = a.build_types(f, [bool])
         assert s == annmodel.SomeString(can_be_None=True)
 
-    def test_method_hasattr(self):
-        class X:
-            def m(self):
-                return 4
-            m.attr = 23
-            def x(self, string):
-                return string
-        x = X()
-        m = x.m
-        def f(string):
-            if hasattr(m, "attr"):
-                return x.x(string)
-            return x.m()
-        a = self.RPythonAnnotator()
-        s = a.build_types(f, [str])
-        assert s == annmodel.SomeString()
-
     def test_dont_see_AttributeError_clause(self):
         class Stuff:
             def _freeze_(self):



More information about the Pypy-commit mailing list