Commit 61ac7b5c authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #1207 from undingen/register_types

PyObject_New: register the type if the type is not yet registered
parents 87f8c6a4 b2a94fc4
......@@ -37,6 +37,9 @@ addons:
- cmake
- g++-4.8
- gdb
- gfortran
- libatlas-dev
- libatlas-base-dev
- libbz2-dev
- libgeoip-dev
- libgmp3-dev
......
......@@ -130,6 +130,12 @@ extern "C" PyObject* PyType_GenericAlloc(PyTypeObject* type, Py_ssize_t nitems)
}
extern "C" PyObject* _PyObject_New(PyTypeObject* tp) noexcept {
// Pyston change: register the type if the type is not yet registered
if (unlikely(tp->tp_dict == NULL)) {
int ret = PyType_Ready(tp);
assert(ret == 0);
}
PyObject* op;
op = (PyObject*)PyObject_MALLOC(_PyObject_SIZE(tp));
if (op == NULL)
......
......@@ -89,7 +89,7 @@ except:
try:
test_helper.run_test(['sh', '-c', '. %s/bin/activate && python %s/numpy/tools/test-installed-numpy.py' % (ENV_DIR, ENV_DIR)],
ENV_NAME, [dict(ran=5781, errors=1, failures=1)])
ENV_NAME, [dict(ran=6139, errors=1, failures=1)])
finally:
if USE_CUSTOM_PATCHES:
print_progress_header("Unpatching NumPy...")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment