Initialization function for the module */
| 5076 | |
| 5077 | /* Initialization function for the module */ |
| 5078 | PyMODINIT_FUNC PyInit__multiarray_umath(void) { |
| 5079 | PyObject *m, *d, *s; |
| 5080 | PyObject *c_api; |
| 5081 | |
| 5082 | /* Create the module and add the functions */ |
| 5083 | m = PyModule_Create(&moduledef); |
| 5084 | if (!m) { |
| 5085 | return NULL; |
| 5086 | } |
| 5087 | |
| 5088 | /* Initialize CPU features */ |
| 5089 | if (npy_cpu_init() < 0) { |
| 5090 | goto err; |
| 5091 | } |
| 5092 | |
| 5093 | #if defined(MS_WIN64) && defined(__GNUC__) |
| 5094 | PyErr_WarnEx(PyExc_Warning, |
| 5095 | "Numpy built with MINGW-W64 on Windows 64 bits is experimental, " \ |
| 5096 | "and only available for \n" \ |
| 5097 | "testing. You are advised not to use it for production. \n\n" \ |
| 5098 | "CRASHES ARE TO BE EXPECTED - PLEASE REPORT THEM TO NUMPY DEVELOPERS", |
| 5099 | 1); |
| 5100 | #endif |
| 5101 | |
| 5102 | /* Initialize access to the PyDateTime API */ |
| 5103 | numpy_pydatetime_import(); |
| 5104 | |
| 5105 | if (PyErr_Occurred()) { |
| 5106 | goto err; |
| 5107 | } |
| 5108 | |
| 5109 | /* Add some symbolic constants to the module */ |
| 5110 | d = PyModule_GetDict(m); |
| 5111 | if (!d) { |
| 5112 | goto err; |
| 5113 | } |
| 5114 | |
| 5115 | if (intern_strings() < 0) { |
| 5116 | goto err; |
| 5117 | } |
| 5118 | |
| 5119 | if (initialize_static_globals() < 0) { |
| 5120 | goto err; |
| 5121 | } |
| 5122 | |
| 5123 | if (PyType_Ready(&PyUFunc_Type) < 0) { |
| 5124 | goto err; |
| 5125 | } |
| 5126 | |
| 5127 | PyArrayDTypeMeta_Type.tp_base = &PyType_Type; |
| 5128 | if (PyType_Ready(&PyArrayDTypeMeta_Type) < 0) { |
| 5129 | goto err; |
| 5130 | } |
| 5131 | |
| 5132 | PyArrayDescr_Type.tp_hash = PyArray_DescrHash; |
| 5133 | Py_SET_TYPE(&PyArrayDescr_Type, &PyArrayDTypeMeta_Type); |
| 5134 | if (PyType_Ready(&PyArrayDescr_Type) < 0) { |
| 5135 | goto err; |
nothing calls this directly
no test coverage detected