Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r94820:bc77e35508e9
Date: 2018-07-06 20:12 +0200
http://bitbucket.org/pypy/pypy/changeset/bc77e35508e9/

Log:    Fix py3.5 translation of the _cppyy module

diff --git a/pypy/module/_cppyy/interp_cppyy.py 
b/pypy/module/_cppyy/interp_cppyy.py
--- a/pypy/module/_cppyy/interp_cppyy.py
+++ b/pypy/module/_cppyy/interp_cppyy.py
@@ -471,11 +471,8 @@
     __new__ = interp2app(MethodWithProps.descr_method__new__.im_func),
     __call__ = interp2app(MethodWithProps.descr_method_call),
     __get__ = interp2app(MethodWithProps.descr_method_get),
-    im_func = interp_attrproperty_w('w_function', cls=MethodWithProps),
     __func__ = interp_attrproperty_w('w_function', cls=MethodWithProps),
-    im_self = interp_attrproperty_w('w_instance', cls=MethodWithProps),
     __self__ = interp_attrproperty_w('w_instance', cls=MethodWithProps),
-    im_class = interp_attrproperty_w('w_class', cls=MethodWithProps),
     __getattribute__ = interp2app(MethodWithProps.descr_method_getattribute),
     __eq__ = interp2app(MethodWithProps.descr_method_eq),
     __ne__ = descr_generic_ne,
@@ -510,9 +507,9 @@
                             not space.is_w(w_obj, space.w_None) or
                             space.is_w(w_cls, space.type(space.w_None)))
         if asking_for_bound:
-            return MethodWithProps(space, self, w_obj, w_cls)
+            return MethodWithProps(space, self, w_obj)
         else:
-            return MethodWithProps(space, self, None, w_cls)
+            return self   # unbound methods don't exist in Python 3
 
     @unwrap_spec(args_w='args_w')
     def call_args(self, args_w):
@@ -600,7 +597,7 @@
 
     def getname(self, space): 
         # for the benefit of Method/instancemethod
-        return capi.c_method_name(space, self.functions[0].cppmethod)
+        return capi.c_method_name(space, 
self.functions[0].cppmethod).decode('latin-1')
 
     def __repr__(self):
         return "W_CPPOverload(%s)" % [f.prototype() for f in self.functions]
@@ -626,7 +623,7 @@
             # onto a class and w_this should be set
             cppinstance = self.space.interp_w(W_CPPInstance, w_obj)
             if cppinstance.clsdecl.handle != self.scope.handle:
-               return MethodWithProps(self.space, self, w_obj, w_cls)    # 
bound
+               return MethodWithProps(self.space, self, w_obj)    # bound
         return self      # unbound
 
     @unwrap_spec(args_w='args_w')
@@ -835,7 +832,7 @@
         return self.getitem_impl(self.name, args_w)
 
     def getname(self, space):
-        return self.name
+        return self.name.decode('latin-1')
 
     def __repr__(self):
         return "W_CPPTemplateOverload(%s)" % [f.prototype() for f in 
self.functions]
@@ -893,7 +890,7 @@
         return self.getitem_impl(self.name, args_w)
 
     def getname(self, space):
-        return self.name
+        return self.name.decode('latin-1')
 
     def __repr__(self):
         return "W_CPPTemplateStaticOverload(%s)" % [f.prototype() for f in 
self.functions]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to