Skip to content
Commit 637969a7 authored by Andrew Burgess's avatar Andrew Burgess
Browse files

gdb/testsuite: handle older Python versions in gdb.python/py-disasm.exp

It was pointed out on the mailing list that the new tests added in
this commit:

  commit 4de4e485
  Date:   Tue Jan 24 15:35:45 2023 +0000

      gdb/python: extend the Python Disassembler API to allow for styling

will fail when GDB is built with Python 3.6 or earlier.  This is
because the error that is emitted when a function argument is missing
changed in Python 3.7, instead of an error like this:

  Python Exception <class 'TypeError'>: function missing required argument 'style' (pos 1)

earlier versions of Python emit:

  Python Exception <class 'TypeError'>: Required argument 'style' (pos 1) not found

and the new tests didn't allow for this.

This commit fixes this by allowing either pattern.  I've tested this
building GDB against Python 3.7.9 and 3.6.15, with this commit all
tests in gdb.python/py-disasm.exp now pass.
parent f1cd8b94
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment