[pypy-commit] pypy py3.6: hg merge cc5fc1bad809 (step-by-step merging with default)
arigo
pypy.commits at gmail.com
Mon Jul 1 07:54:01 EDT 2019
Author: Armin Rigo <arigo at tunes.org>
Branch: py3.6
Changeset: r96893:a2bc01dcf303
Date: 2019-07-01 13:39 +0200
http://bitbucket.org/pypy/pypy/changeset/a2bc01dcf303/
Log: hg merge cc5fc1bad809 (step-by-step merging with default)
diff --git a/pypy/module/cpyext/test/array.c b/pypy/module/cpyext/test/array.c
--- a/pypy/module/cpyext/test/array.c
+++ b/pypy/module/cpyext/test/array.c
@@ -3017,6 +3017,11 @@
Py_RETURN_NONE;
}
+static PyObject *
+passthrough(PyObject *self, PyObject* args) {
+ Py_INCREF(args);
+ return args;
+}
/*********************** Install Module **************************/
static PyMethodDef a_methods[] = {
@@ -3030,6 +3035,7 @@
{"same_dealloc", (PyCFunction)same_dealloc, METH_VARARGS, NULL},
{"getitem", (PyCFunction)getitem, METH_VARARGS, NULL},
{"subclass_with_attribute", (PyCFunction)subclass_with_attribute, METH_VARARGS, NULL},
+ {"passthrough", (PyCFunction)passthrough, METH_O, NULL},
{NULL, NULL, 0, NULL} /* Sentinel */
};
diff --git a/pypy/module/cpyext/test/test_arraymodule.py b/pypy/module/cpyext/test/test_arraymodule.py
--- a/pypy/module/cpyext/test/test_arraymodule.py
+++ b/pypy/module/cpyext/test/test_arraymodule.py
@@ -67,6 +67,9 @@
else:
expected = b'\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04\0\0\0'
assert bytes(buf) == expected
+ # make sure memory_attach is called
+ buf2 = module.passthrough(buf)
+ assert str(buf2) == str(buf)
def test_releasebuffer(self):
module = self.import_module(name='array')
More information about the pypy-commit
mailing list