GDB: Prefer Python 3 over 2

This fixes the build of a recent GDB version:

gdb/python/py-micmd.c: In function 'int micmdpy_uninstall_command(micmdpy_object*)':
gdb/python/py-micmd.c:430:20: error: 'PyDict_GetItemWithError' was not declared in this scope
   PyObject *curr = PyDict_GetItemWithError (mi_cmd_dict.get (),
                    ^~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Sebastian Huber 2022-03-17 12:49:20 +01:00
parent 6fe98f91d9
commit 571a182d4a

View File

@ -42,7 +42,7 @@
# 2. Does the version of gdb specify a version of python that must be
# used. Override with '%define gdb-python-version python2'.
#
# 3. Search for 'python2' and if not found search for 'python3'.
# 3. Search for 'python3' and if not found search for 'python2'.
#
%if %{defined gdb-python2}
%define gdb-enable-python %{gdb_python2}
@ -53,9 +53,9 @@
%if %{defined gdb-python-version}
%define gdb-enable-python %(command -v %{gdb-python-version} || true)
%else
%define gdb-enable-python %(command -v python2 || true)
%define gdb-enable-python %(command -v python3 || true)
%if %{gdb-enable-python} == %{nil}
%define gdb-enable-python %(command -v python3 || true)
%define gdb-enable-python %(command -v python2 || true)
%endif
%if %{gdb-enable-python} == %{nil}
%define gdb-enable-python %(command -v python || true})