Import */
| 13351 | |
| 13352 | /* Import */ |
| 13353 | static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { |
| 13354 | PyObject *empty_list = 0; |
| 13355 | PyObject *module = 0; |
| 13356 | PyObject *global_dict = 0; |
| 13357 | PyObject *empty_dict = 0; |
| 13358 | PyObject *list; |
| 13359 | #if PY_MAJOR_VERSION < 3 |
| 13360 | PyObject *py_import; |
| 13361 | py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); |
| 13362 | if (!py_import) |
| 13363 | goto bad; |
| 13364 | #endif |
| 13365 | if (from_list) |
| 13366 | list = from_list; |
| 13367 | else { |
| 13368 | empty_list = PyList_New(0); |
| 13369 | if (!empty_list) |
| 13370 | goto bad; |
| 13371 | list = empty_list; |
| 13372 | } |
| 13373 | global_dict = PyModule_GetDict(__pyx_m); |
| 13374 | if (!global_dict) |
| 13375 | goto bad; |
| 13376 | empty_dict = PyDict_New(); |
| 13377 | if (!empty_dict) |
| 13378 | goto bad; |
| 13379 | { |
| 13380 | #if PY_MAJOR_VERSION >= 3 |
| 13381 | if (level == -1) { |
| 13382 | if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { |
| 13383 | module = PyImport_ImportModuleLevelObject( |
| 13384 | name, global_dict, empty_dict, list, 1); |
| 13385 | if (!module) { |
| 13386 | if (!PyErr_ExceptionMatches(PyExc_ImportError)) |
| 13387 | goto bad; |
| 13388 | PyErr_Clear(); |
| 13389 | } |
| 13390 | } |
| 13391 | level = 0; |
| 13392 | } |
| 13393 | #endif |
| 13394 | if (!module) { |
| 13395 | #if PY_MAJOR_VERSION < 3 |
| 13396 | PyObject *py_level = PyInt_FromLong(level); |
| 13397 | if (!py_level) |
| 13398 | goto bad; |
| 13399 | module = PyObject_CallFunctionObjArgs(py_import, |
| 13400 | name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); |
| 13401 | Py_DECREF(py_level); |
| 13402 | #else |
| 13403 | module = PyImport_ImportModuleLevelObject( |
| 13404 | name, global_dict, empty_dict, list, level); |
| 13405 | #endif |
| 13406 | } |
| 13407 | } |
| 13408 | bad: |
| 13409 | #if PY_MAJOR_VERSION < 3 |
| 13410 | Py_XDECREF(py_import); |
no test coverage detected