From: Daniel Elstner Date: Sat, 10 Oct 2015 02:45:13 +0000 (+0200) Subject: python: Fix PyObject_CallMethod() arguments X-Git-Tag: libsigrok-0.4.0~213 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fa72105fe621bce7767f2b3512223182f2bf6f33;p=libsigrok.git python: Fix PyObject_CallMethod() arguments Pass nullptr instead of the empty string for format, and remove the excess varargs argument. Also, avoid NULL in favor of nullptr. --- diff --git a/bindings/python/sigrok/core/classes.i b/bindings/python/sigrok/core/classes.i index be4df153..347a7e22 100644 --- a/bindings/python/sigrok/core/classes.i +++ b/bindings/python/sigrok/core/classes.i @@ -74,7 +74,7 @@ typedef guint pyg_flags_type; if (!GLib) { fprintf(stderr, "Import of gi.repository.GLib failed.\n"); #if PY_VERSION_HEX >= 0x03000000 - return NULL; + return nullptr; #else return; #endif @@ -94,8 +94,7 @@ typedef guint pyg_flags_type; g_value_set_variant(value, $1.gobj()); PyObject *variant = pyg_value_as_pyobject(value, true); $result = PyObject_CallMethod(variant, - const_cast("unpack"), - const_cast(""), NULL); + const_cast("unpack"), nullptr); Py_XDECREF(variant); g_free(value); }