Switch to unified view

a/src/python/recoll/pyrclextract.cpp b/src/python/recoll/pyrclextract.cpp
...
...
342
    PyModule_AddObject(module, "Extractor", (PyObject *)&rclx_ExtractorType);
342
    PyModule_AddObject(module, "Extractor", (PyObject *)&rclx_ExtractorType);
343
343
344
#if PY_MAJOR_VERSION >= 3 || (PY_MAJOR_VERSION >= 2 && PY_MINOR_VERSION >= 7)
344
#if PY_MAJOR_VERSION >= 3 || (PY_MAJOR_VERSION >= 2 && PY_MINOR_VERSION >= 7)
345
    recoll_DocType = (PyObject*)PyCapsule_Import(PYRECOLL_PACKAGE "recoll.doctypeptr", 0);
345
    recoll_DocType = (PyObject*)PyCapsule_Import(PYRECOLL_PACKAGE "recoll.doctypeptr", 0);
346
#else
346
#else
347
    PyObject *module = PyImport_ImportModule(PYRECOLL_PACKAGE "recoll");
347
    PyObject *module1 = PyImport_ImportModule(PYRECOLL_PACKAGE "recoll");
348
    if (module != NULL) {
348
    if (module1 != NULL) {
349
        PyObject *cobject = PyObject_GetAttrString(module, "_C_API");
349
        PyObject *cobject = PyObject_GetAttrString(module1, "doctypeptr");
350
        if (cobject == NULL)
350
        if (cobject == NULL)
351
            INITERROR;
351
            INITERROR;
352
        if (PyCObject_Check(cobject))
352
        if (PyCObject_Check(cobject))
353
            recoll_DocType = (PyObject*)PyCObject_AsVoidPtr(cobject);
353
            recoll_DocType = (PyObject*)PyCObject_AsVoidPtr(cobject);
354
        Py_DECREF(cobject);
354
        Py_DECREF(cobject);