Switch to unified view

a/src/python/recoll/pyrclextract.cpp b/src/python/recoll/pyrclextract.cpp
...
...
289
    if (PyType_Ready(&rclx_ExtractorType) < 0)
289
    if (PyType_Ready(&rclx_ExtractorType) < 0)
290
        return;
290
        return;
291
    Py_INCREF(&rclx_ExtractorType);
291
    Py_INCREF(&rclx_ExtractorType);
292
    PyModule_AddObject(m, "Extractor", (PyObject *)&rclx_ExtractorType);
292
    PyModule_AddObject(m, "Extractor", (PyObject *)&rclx_ExtractorType);
293
293
294
#if PY_MAJOR_VERSION >= 2 && PY_MINOR_VERSION >= 7
294
    recoll_DocType = (PyObject*)PyCapsule_Import(PYRECOLL_PACKAGE "recoll.doctypeptr", 0);
295
    recoll_DocType = (PyObject*)PyCapsule_Import(PYRECOLL_PACKAGE "recoll.doctypeptr", 0);
296
#else
297
    PyObject *module = PyImport_ImportModule(PYRECOLL_PACKAGE "recoll");
298
    if (module != NULL) {
299
        PyObject *cobject = PyObject_GetAttrString(module, "_C_API");
300
        if (cobject == NULL)
301
            return;
302
        if (PyCObject_Check(cobject))
303
            recoll_DocType = (PyObject*)PyCObject_AsVoidPtr(cobject);
304
        Py_DECREF(cobject);
305
    }
306
#endif
295
}
307
}