Author: Matti Picus <[email protected]>
Branch:
Changeset: r92400:921cf6b61598
Date: 2017-09-15 11:01 +0300
http://bitbucket.org/pypy/pypy/changeset/921cf6b61598/
Log: remove redundant test, fix translation
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -81,3 +81,7 @@
.. branch: pycheck-macros
Convert many Py*_Check cpyext functions into macros, like CPython.
+
+.. branch: py_ssize_t
+
+Explicitly use Py_ssize_t as the Signed type in pypy c-api
diff --git a/pypy/module/cpyext/methodobject.py
b/pypy/module/cpyext/methodobject.py
--- a/pypy/module/cpyext/methodobject.py
+++ b/pypy/module/cpyext/methodobject.py
@@ -110,20 +110,20 @@
def descr_method_repr(self):
return self.space.newtext("<method '%s' of '%s' objects>" % (
- self.name, self.w_objclass.name))
+ self.name, self.w_objclass.getname(self.space)))
def descr_call(self, space, __args__):
args_w, kw_w = __args__.unpack()
if len(args_w) < 1:
raise oefmt(space.w_TypeError,
"descriptor '%s' of '%s' object needs an argument",
- self.name, self.w_objclass.name)
+ self.name, self.w_objclass.getname(self.space))
w_instance = args_w[0]
# XXX: needs a stricter test
if not space.isinstance_w(w_instance, self.w_objclass):
raise oefmt(space.w_TypeError,
"descriptor '%s' requires a '%s' object but received a '%T'",
- self.name, self.w_objclass.name, w_instance)
+ self.name, self.w_objclass.getname(self.space), w_instance)
w_args = space.newtuple(args_w[1:])
w_kw = space.newdict()
for key, w_obj in kw_w.items():
diff --git a/pypy/module/cpyext/test/test_methodobject.py
b/pypy/module/cpyext/test/test_methodobject.py
--- a/pypy/module/cpyext/test/test_methodobject.py
+++ b/pypy/module/cpyext/test/test_methodobject.py
@@ -117,25 +117,3 @@
assert mod.check(A.meth) == 0
assert mod.check(A.stat) == 0
-
-class TestPyCMethodObject(BaseApiTest):
- def test_repr(self, space, api):
- """
- W_PyCMethodObject has a repr string which describes it as a method
- and gives its name and the name of its class.
- """
- def func(space, w_self, w_args):
- return space.w_None
- c_func = ApiFunction([PyObject, PyObject], PyObject, func)
- func.api_func = c_func
- ml = lltype.malloc(PyMethodDef, flavor='raw', zero=True)
- namebuf = rffi.cast(rffi.CONST_CCHARP, rffi.str2charp('func'))
- ml.c_ml_name = namebuf
- ml.c_ml_meth = rffi.cast(PyCFunction, c_func.get_llhelper(space))
-
- method = api.PyDescr_NewMethod(space.w_bytes, ml)
- assert repr(method).startswith(
- "<built-in method 'func' of 'str' object ")
-
- rffi.free_charp(namebuf)
- lltype.free(ml, flavor='raw')
diff --git a/rpython/rlib/rsocket.py b/rpython/rlib/rsocket.py
--- a/rpython/rlib/rsocket.py
+++ b/rpython/rlib/rsocket.py
@@ -846,7 +846,8 @@
def getsockopt_int(self, level, option):
flag_p = lltype.malloc(rffi.INTP.TO, 1, flavor='raw')
# some win32 calls use only a byte to represent a bool
- flag_p[0] = 0
+ # zero out so the result is correct anyway
+ flag_p[0] = rffi.cast(rffi.INT, 0)
try:
flagsize_p = lltype.malloc(_c.socklen_t_ptr.TO, flavor='raw')
try:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit