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.
This commit is contained in:
Daniel Elstner 2015-10-10 04:45:13 +02:00
parent 2c3c9b999c
commit fa72105fe6
1 changed files with 2 additions and 3 deletions

View File

@ -74,7 +74,7 @@ typedef guint pyg_flags_type;
if (!GLib) { if (!GLib) {
fprintf(stderr, "Import of gi.repository.GLib failed.\n"); fprintf(stderr, "Import of gi.repository.GLib failed.\n");
#if PY_VERSION_HEX >= 0x03000000 #if PY_VERSION_HEX >= 0x03000000
return NULL; return nullptr;
#else #else
return; return;
#endif #endif
@ -94,8 +94,7 @@ typedef guint pyg_flags_type;
g_value_set_variant(value, $1.gobj()); g_value_set_variant(value, $1.gobj());
PyObject *variant = pyg_value_as_pyobject(value, true); PyObject *variant = pyg_value_as_pyobject(value, true);
$result = PyObject_CallMethod(variant, $result = PyObject_CallMethod(variant,
const_cast<char *>("unpack"), const_cast<char *>("unpack"), nullptr);
const_cast<char *>(""), NULL);
Py_XDECREF(variant); Py_XDECREF(variant);
g_free(value); g_free(value);
} }