[PATCH 1/2] Remove argument handling from methods without arguments

David Shea dshea at redhat.com
Fri Sep 12 20:03:24 UTC 2014


We can just declare them as METH_NOARGS and not worry about it, instead.
---
 pyanaconda/isys/isys.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c
index 3de0d79..10a43e6 100644
--- a/pyanaconda/isys/isys.c
+++ b/pyanaconda/isys/isys.c
@@ -34,8 +34,8 @@ static PyObject * doSegvHandler(PyObject *s, PyObject *args);
 static PyObject * doSetSystemTime(PyObject *s, PyObject *args);
 
 static PyMethodDef isysModuleMethods[] = {
-    { "sync", (PyCFunction) doSync, METH_VARARGS, NULL},
-    { "handleSegv", (PyCFunction) doSegvHandler, METH_VARARGS, NULL },
+    { "sync", (PyCFunction) doSync, METH_NOARGS, NULL},
+    { "handleSegv", (PyCFunction) doSegvHandler, METH_NOARGS, NULL },
     { "set_system_time", (PyCFunction) doSetSystemTime, METH_VARARGS, NULL},
     { NULL, NULL, 0, NULL }
 } ;
@@ -46,9 +46,6 @@ void init_isys(void) {
 }
 
 static PyObject * doSync(PyObject * s, PyObject * args) {
-    int fd;
-
-    if (!PyArg_ParseTuple(args, "", &fd)) return NULL;
     sync();
 
     Py_INCREF(Py_None);
-- 
2.1.0



More information about the anaconda-patches mailing list