Commit eaecf7a0 authored by Robert Bradshaw's avatar Robert Bradshaw

Use shared module for more Cython types.

parent ee1dc804
......@@ -10,7 +10,7 @@ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* sys_modules = NULL;
PyObject* args = NULL;
PyTypeObject* cached_type = NULL;
char* cython_module = "_cython_" CYTHON_ABI;
const char* cython_module = "_cython_" CYTHON_ABI;
if (fake_module == NULL) {
sys = PyImport_ImportModule("sys"); if (sys == NULL) goto bad;
sys_modules = PyObject_GetAttrString(sys, "modules"); if (sys_modules == NULL) goto bad;
......
......@@ -646,15 +646,10 @@ static int __Pyx_CyFunction_init(void) {
// avoid a useless level of call indirection
__pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
#if 1
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
if (__pyx_CyFunctionType == NULL)
if (__pyx_CyFunctionType == NULL) {
return -1;
#else
if (PyType_Ready(&__pyx_CyFunctionType_type) < 0)
return -1;
__pyx_CyFunctionType = &__pyx_CyFunctionType_type;
#endif
}
return 0;
}
......@@ -1095,10 +1090,10 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
};
static int __pyx_FusedFunction_init(void) {
if (PyType_Ready(&__pyx_FusedFunctionType_type) < 0) {
__pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type);
if (__pyx_FusedFunctionType == NULL) {
return -1;
}
__pyx_FusedFunctionType = &__pyx_FusedFunctionType_type;
return 0;
}
......
......@@ -57,6 +57,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
//@requires: Exceptions.c::SwapException
//@requires: Exceptions.c::RaiseException
//@requires: ObjectHandling.c::PyObjectCallMethod
//@requires: CommonTypes.c::FetchCommonType
static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
......@@ -653,9 +654,10 @@ static int __pyx_Generator_init(void) {
/* on Windows, C-API functions can't be used in slots statically */
__pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
__pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
if (PyType_Ready(&__pyx_GeneratorType_type)) {
__pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
if (__pyx_GeneratorType == NULL) {
return -1;
}
__pyx_GeneratorType = &__pyx_GeneratorType_type;
return 0;
}
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