Author: Matti Picus <matti.pi...@gmail.com> Branch: PyTuple_Type-subclass Changeset: r85371:a4fda7270791 Date: 2016-06-24 16:24 +0300 http://bitbucket.org/pypy/pypy/changeset/a4fda7270791/
Log: merge default into branch diff --git a/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h b/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h --- a/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h +++ b/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h @@ -5,7 +5,12 @@ npy_bool obval; } PyBoolScalarObject; -static int import_array(){return 0;}; -static int _import_array(){return 0;}; -static int _import_math(){return 0;}; +#if PY_VERSION_HEX >= 0x03000000 +#define NUMPY_IMPORT_ARRAY_RETVAL NULL +#else +#define NUMPY_IMPORT_ARRAY_RETVAL +#endif +#define import_array() {return NUMPY_IMPORT_ARRAY_RETVAL;} + + diff --git a/pypy/module/cpyext/test/test_bytearrayobject.py b/pypy/module/cpyext/test/test_bytearrayobject.py --- a/pypy/module/cpyext/test/test_bytearrayobject.py +++ b/pypy/module/cpyext/test/test_bytearrayobject.py @@ -17,24 +17,10 @@ """ PyObject* s = PyByteArray_FromStringAndSize("Hello world", 12); int result = 0; - size_t expected_size; if(PyByteArray_Size(s) == 12) { result = 1; } - #ifdef PYPY_VERSION - expected_size = sizeof(void*)*3; - #elif defined Py_DEBUG - expected_size = 64; - #else - expected_size = 48; - #endif - if(s->ob_type->tp_basicsize != expected_size) - { - printf("tp_basicsize==%ld\\n", - (long)s->ob_type->tp_basicsize); - result = 0; - } Py_DECREF(s); return PyBool_FromLong(result); """), diff --git a/pypy/module/cpyext/test/test_bytesobject.py b/pypy/module/cpyext/test/test_bytesobject.py --- a/pypy/module/cpyext/test/test_bytesobject.py +++ b/pypy/module/cpyext/test/test_bytesobject.py @@ -25,23 +25,8 @@ ("test_Size", "METH_NOARGS", """ PyObject* s = PyString_FromString("Hello world"); - int result; - size_t expected_size; + int result = PyString_Size(s); - result = PyString_Size(s); - - #ifdef PYPY_VERSION - expected_size = 48; - #elif defined Py_DEBUG - expected_size = 53; - #else - expected_size = 37; - #endif - if(s->ob_type->tp_basicsize != expected_size) - { - printf("tp_basicsize==%zd\\n", s->ob_type->tp_basicsize); - result = 0; - } Py_DECREF(s); return PyLong_FromLong(result); """), _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit