Workaround Python 2.6.
	* python/py-utils.c (gdb_pymodule_addobject): Wrap Py_DECREF into
	a block.
This commit is contained in:
Jan Kratochvil 2013-05-21 15:02:28 +00:00
parent 44e9736318
commit ff6009d09a
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-05-21 Jan Kratochvil <jan.kratochvil@redhat.com>
Workaround Python 2.6.
* python/py-utils.c (gdb_pymodule_addobject): Wrap Py_DECREF into
a block.
2013-05-21 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup: constification.

View File

@ -443,6 +443,9 @@ gdb_pymodule_addobject (PyObject *module, const char *name, PyObject *object)
Py_INCREF (object);
result = PyModule_AddObject (module, name, object);
if (result < 0)
Py_DECREF (object);
{
/* Python 2.6 did not wrap Py_DECREF in do { } while (0);. */
Py_DECREF (object);
}
return result;
}