aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-05-21 15:02:28 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-05-21 15:02:28 +0000
commitff6009d09aa0af0ac263d820b2beb9b47d8813ea (patch)
tree928c7863bc84b57b0890206ed0db32ba54935cd3 /gdb/python
parent44e9736318429d5b2adb158299dac4d983096104 (diff)
downloadgdb-ff6009d09aa0af0ac263d820b2beb9b47d8813ea.zip
gdb-ff6009d09aa0af0ac263d820b2beb9b47d8813ea.tar.gz
gdb-ff6009d09aa0af0ac263d820b2beb9b47d8813ea.tar.bz2
gdb/
Workaround Python 2.6. * python/py-utils.c (gdb_pymodule_addobject): Wrap Py_DECREF into a block.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c
index d87eb8c..e78dee0 100644
--- a/gdb/python/py-utils.c
+++ b/gdb/python/py-utils.c
@@ -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;
}