summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2022-07-20 17:00:24 -0700
committerKevin Buettner <kevinb@redhat.com>2022-07-20 17:12:08 -0700
commit0679db296682575b4d34fc8686fbbeb305b283e9 (patch)
tree5f2ad61258ded3f25609f0129f56fda2970e3fd8
parent2637e8bb1ad92733464488af4c0621cc8851e215 (diff)
downloadbinutils-gdb-0679db296682575b4d34fc8686fbbeb305b283e9.tar.gz
Wrap python_write_bytecode with HAVE_PYTHON ifdef
This commit fixes a build error on machines lacking python headers and/or libraries.
-rw-r--r--gdb/python/python.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index c719e3dc90c..8fa935c8286 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1855,6 +1855,7 @@ show_python_dont_write_bytecode (struct ui_file *file, int from_tty,
value);
}
+#ifdef HAVE_PYTHON
/* Return value to assign to PyConfig.write_bytecode or, when
negated (via !), Py_DontWriteBytecodeFlag. Py_DontWriteBytecodeFlag
is deprecated in Python 3.12. */
@@ -1872,6 +1873,7 @@ python_write_bytecode ()
return wbc;
}
+#endif /* HAVE_PYTHON */
/* Implement 'set python dont-write-bytecode'. This sets Python's internal
flag no matter when the command is issued, however, if this is used