diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-13 15:14:32 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-13 15:14:32 +0200 |
| commit | f883d8f68487728946fd12bcfaa6a7e234288f4c (patch) | |
| tree | 64b81dffc538a8c6737fb71e77034787185c3925 | |
| parent | 8e3c0bf27b47835069a1e78c6dc4180c6efa883b (diff) | |
| download | python-apt-f883d8f68487728946fd12bcfaa6a7e234288f4c.tar.gz | |
python/apt_pkgmodule.cc, python/apt_instmodule.cc: Remove useless state.
This was copied over from "Porting Extension Modules to 3.0", and is not
really needed.
| -rw-r--r-- | python/apt_instmodule.cc | 27 | ||||
| -rw-r--r-- | python/apt_pkgmodule.cc | 29 |
2 files changed, 13 insertions, 43 deletions
diff --git a/python/apt_instmodule.cc b/python/apt_instmodule.cc index 84479fcb..5aca4e00 100644 --- a/python/apt_instmodule.cc +++ b/python/apt_instmodule.cc @@ -170,31 +170,16 @@ static PyMethodDef methods[] = }; #if PY_MAJOR_VERSION >= 3 -struct module_state { - PyObject *error; -}; -#define GETSTATE(m) ((struct module_state*)PyModule_GetState(m)) - -static int apt_inst_traverse(PyObject *m, visitproc visit, void *arg) { - Py_VISIT(GETSTATE(m)->error); - return 0; -} - -static int apt_inst_clear(PyObject *m) { - Py_CLEAR(GETSTATE(m)->error); - return 0; -} - static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "apt_inst", - NULL, - sizeof(struct module_state), + "Functions for working with packages and ar,tar archives (apt-inst)", + -1, methods, - NULL, - apt_inst_traverse, - apt_inst_clear, - NULL + 0, + 0, + 0, + 0 }; extern "C" PyObject * PyInit_apt_inst() diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 3146298b..7ffe1236 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -522,32 +522,17 @@ static PyMethodDef methods[] = #if PY_MAJOR_VERSION >= 3 -struct module_state { - PyObject *error; -}; - -#define GETSTATE(m) ((struct module_state*)PyModule_GetState(m)) - -static int apt_inst_traverse(PyObject *m, visitproc visit, void *arg) { - Py_VISIT(GETSTATE(m)->error); - return 0; -} - -static int apt_inst_clear(PyObject *m) { - Py_CLEAR(GETSTATE(m)->error); - return 0; -} - static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "apt_pkg", - NULL, - sizeof(struct module_state), + "Classes and functions wrapping the apt-pkg library.\n\n" + "The apt_pkg module provides...", + -1, methods, - NULL, - apt_inst_traverse, - apt_inst_clear, - NULL + 0, + 0, + 0, + 0, }; #define INIT_ERROR return 0 |
