Author: Matti Picus <[email protected]>
Branch:
Changeset: r94834:b42a5efd4312
Date: 2018-07-08 17:58 -0700
http://bitbucket.org/pypy/pypy/changeset/b42a5efd4312/
Log: fix translation
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
@@ -510,7 +510,7 @@
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)
+ return MethodWithProps(space, self, w_obj, w_cls)
else:
return self # unbound methods don't exist in Python 3, return self
@@ -626,7 +626,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) # bound
+ return MethodWithProps(self.space, self, w_obj, w_cls) #
bound
return self # unbound
@unwrap_spec(args_w='args_w')
diff --git a/pypy/module/cpyext/cdatetime.py b/pypy/module/cpyext/cdatetime.py
--- a/pypy/module/cpyext/cdatetime.py
+++ b/pypy/module/cpyext/cdatetime.py
@@ -135,6 +135,7 @@
'''Fills a newly allocated py_obj from the w_obj
If it is a datetime.time or datetime.datetime, it may have tzinfo
'''
+ assert len(datetimeAPI_global) > 0
if datetimeAPI_global[0].c_TimeType == py_obj.c_ob_type:
py_datetime = rffi.cast(PyDateTime_Time, py_obj)
w_tzinfo = space.getattr(w_obj, space.newtext('tzinfo'))
@@ -158,6 +159,7 @@
@slot_function([PyObject], lltype.Void)
def type_dealloc(space, py_obj):
from pypy.module.cpyext.object import _dealloc
+ assert len(datetimeAPI_global) > 0
if datetimeAPI_global[0].c_TimeType == py_obj.c_ob_type:
py_datetime = rffi.cast(PyDateTime_Time, py_obj)
if (widen(py_datetime.c_hastzinfo) != 0):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit