[libvirt] [python PATCH 1/4] libvirt-utils: remove unused py_str function

Pavel Hrdina posted 4 patches 6 years, 11 months ago
[libvirt] [python PATCH 1/4] libvirt-utils: remove unused py_str function
Posted by Pavel Hrdina 6 years, 11 months ago
Commit <57a160b5248ba47d4e1c9d22d95847dad8e0524f> removed last usage
but did not remove the function itself.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 libvirt-utils.c | 14 --------------
 libvirt-utils.h |  1 -
 2 files changed, 15 deletions(-)

diff --git a/libvirt-utils.c b/libvirt-utils.c
index f7b4478..e17e794 100644
--- a/libvirt-utils.c
+++ b/libvirt-utils.c
@@ -199,20 +199,6 @@ virTypedParamsFree(virTypedParameterPtr params,
 }
 #endif /* ! LIBVIR_CHECK_VERSION(1, 0, 2) */
 
-char *
-py_str(PyObject *obj)
-{
-    PyObject *str = PyObject_Str(obj);
-    char *ret;
-    if (!str) {
-        PyErr_Print();
-        PyErr_Clear();
-        return NULL;
-    };
-    libvirt_charPtrUnwrap(str, &ret);
-    return ret;
-}
-
 /* Helper function to convert a virTypedParameter output array into a
  * Python dictionary for return to the user.  Return NULL on failure,
  * after raising a python exception.  */
diff --git a/libvirt-utils.h b/libvirt-utils.h
index 0af1e62..cc3d278 100644
--- a/libvirt-utils.h
+++ b/libvirt-utils.h
@@ -319,7 +319,6 @@ void virTypedParamsClear(virTypedParameterPtr params, int nparams);
 void virTypedParamsFree(virTypedParameterPtr params, int nparams);
 # endif /* ! LIBVIR_CHECK_VERSION(1, 0, 2) */
 
-char * py_str(PyObject *obj);
 PyObject * getPyVirTypedParameter(const virTypedParameter *params,
                                   int nparams);
 virTypedParameterPtr setPyVirTypedParameter(PyObject *info,
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [python PATCH 1/4] libvirt-utils: remove unused py_str function
Posted by Ján Tomko 6 years, 11 months ago
On Tue, Jun 12, 2018 at 07:16:38AM +0200, Pavel Hrdina wrote:
>Commit <57a160b5248ba47d4e1c9d22d95847dad8e0524f> removed last usage
>but did not remove the function itself.
>
>Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
>---
> libvirt-utils.c | 14 --------------
> libvirt-utils.h |  1 -
> 2 files changed, 15 deletions(-)
>

Beautiful diffstat.

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list