aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r--gdb/python/python.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 7e28eb6..24cb511 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1612,16 +1612,19 @@ gdbpy_flush (PyObject *self, PyObject *args, PyObject *kw)
{
case 1:
{
- gdb_flush (gdb_stderr);
+ if (gdb_stderr != nullptr)
+ gdb_flush (gdb_stderr);
break;
}
case 2:
{
- gdb_flush (gdb_stdlog);
+ if (gdb_stdlog != nullptr)
+ gdb_flush (gdb_stdlog);
break;
}
default:
- gdb_flush (gdb_stdout);
+ if (gdb_stdout != nullptr)
+ gdb_flush (gdb_stdout);
}
Py_RETURN_NONE;