[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

PATCH [4/5]: pyblock: Py_GenericNew does not do anything with its args argument.



Py_GenericNew does not do anything with its args argument, so no need to
build one.
---
 dmraid.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/dmraid.c b/dmraid.c
index 5b5cf6c..51d4ad6 100644
--- a/dmraid.c
+++ b/dmraid.c
@@ -850,7 +850,7 @@ pydmraid_raidset_get_map(PyObject *self, void *data)
 	struct raid_set *rs = set->rs;

 	PyObject *m = NULL, *md = NULL;
-	PyObject *type = NULL, *args = NULL;
+	PyObject *type = NULL;
 	PyObject *map = NULL, *table = NULL;

 	PyObject *iret = NULL;
@@ -859,10 +859,6 @@ pydmraid_raidset_get_map(PyObject *self, void *data)
 	if (!table)
 		goto out;

-	args = Py_BuildValue("(sO)", rs->name, table);
-	if (!args)
-		goto out;
-
 	m = PyImport_ImportModule("block.dm");
 	if (!m)
 		goto out;
@@ -875,7 +871,7 @@ pydmraid_raidset_get_map(PyObject *self, void *data)
 	if (!type)
 		goto out;

-	map = PyType_GenericNew((PyTypeObject *)type, args, NULL);
+	map = PyType_GenericNew((PyTypeObject *)type, NULL, NULL);
 	if (!map)
 		goto out;

@@ -887,7 +883,6 @@ pydmraid_raidset_get_map(PyObject *self, void *data)

 out:
 	Py_XDECREF(iret);
-	Py_XDECREF(args);
 	Py_XDECREF(table);
 	if (!map && !PyErr_Occurred()) {
 		if (errno != 0)
--
1.6.1.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]