Skip to content

Commit 1c709fd

Browse files
committed
refactor: remove unused igraphmodule_resolve_graph_weakref
1 parent 75610b3 commit 1c709fd

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

src/_igraph/common.c

-24
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,3 @@ PyObject* igraphmodule_unimplemented(PyObject* self, PyObject* args, PyObject* k
4646
PyErr_SetString(PyExc_NotImplementedError, "This method is unimplemented.");
4747
return NULL;
4848
}
49-
50-
/**
51-
* \ingroup python_interface
52-
* \brief Resolves a weak reference to an \c igraph.Graph
53-
* \return the \c igraph.Graph object or NULL if the weak reference is dead.
54-
* Sets an exception in the latter case.
55-
*/
56-
PyObject* igraphmodule_resolve_graph_weakref(PyObject* ref) {
57-
PyObject *o;
58-
59-
#ifndef PYPY_VERSION
60-
/* PyWeakref_Check is not implemented in PyPy yet */
61-
if (!PyWeakref_Check(ref)) {
62-
PyErr_SetString(PyExc_TypeError, "weak reference expected");
63-
return NULL;
64-
}
65-
#endif /* PYPY_VERSION */
66-
o=PyWeakref_GetObject(ref);
67-
if (o == Py_None) {
68-
PyErr_SetString(PyExc_TypeError, "underlying graph has already been destroyed");
69-
return NULL;
70-
}
71-
return o;
72-
}

src/_igraph/common.h

-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,4 @@
5151
#define ATTRIBUTE_TYPE_EDGE 2
5252

5353
PyObject* igraphmodule_unimplemented(PyObject* self, PyObject* args, PyObject* kwds);
54-
PyObject* igraphmodule_resolve_graph_weakref(PyObject* ref);
5554
#endif

0 commit comments

Comments
 (0)