Commit 132fdf5d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f9070e77
...@@ -958,6 +958,7 @@ pyfile_new(PyTypeObject *type, PyObject *args, PyObject *kw) ...@@ -958,6 +958,7 @@ pyfile_new(PyTypeObject *type, PyObject *args, PyObject *kw)
{ {
PyBigFile *self; PyBigFile *self;
PyObject *blkmmapper; PyObject *blkmmapper;
bigfile_ops *blkmmap_ops = NULL;
blkmmapper = PyObject_GetAttrString((PyObject*)type, "blkmmapper"); blkmmapper = PyObject_GetAttrString((PyObject*)type, "blkmmapper");
PyErr_Clear(); /* GetAttr raises exception if there is no attribute */ PyErr_Clear(); /* GetAttr raises exception if there is no attribute */
...@@ -967,6 +968,12 @@ pyfile_new(PyTypeObject *type, PyObject *args, PyObject *kw) ...@@ -967,6 +968,12 @@ pyfile_new(PyTypeObject *type, PyObject *args, PyObject *kw)
return PyErr_Format(PyExc_TypeError, return PyErr_Format(PyExc_TypeError,
"%s: .blkmmapper is not a valid pycapsule with mmap methods", type->tp_name); "%s: .blkmmapper is not a valid pycapsule with mmap methods", type->tp_name);
} }
blkmmap_ops = PyCapsule_GetPointer(blkmmapper, "wendelin.bigfile.IBlkMMapper");
if (blkmmap_ops == NULL) { /* just in case - must not fail */
Py_DECREF(blkmmapper);
return NULL;
}
} }
self = (PyBigFile *)PyType_GenericNew(type, args, kw); self = (PyBigFile *)PyType_GenericNew(type, args, kw);
......
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