Browse Source

tests, scripts: Don't import print_function from __future__

Some of our Python scripts still include the line
  from __future__ import print_function

which is intended to allow a Python 2 to handle the Python 3 print()
syntax. This particular part of the future arrived many years ago,
and our minimum Python version is 3.9, so we don't need to keep
this line around.

NB: the scripts in tests/tcg/*/gdbstub/ are run with whatever Python
gdb was built against, but we can safely assume that that was a
Python 3 because our supported distros are all on Python 3.  In any
case these are only run as part of "make check-tcg", not by
end-users.

Commit created with:

 sed -i -e '/import print_function/d' $(git grep -l 'from __future__')

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20250819102409.2117969-1-peter.maydell@linaro.org
pull/305/head
Peter Maydell 7 months ago
parent
commit
424dc390ec
  1. 1
      scripts/userfaultfd-wrlat.py
  2. 1
      tests/guest-debug/test_gdbstub.py
  3. 1
      tests/tcg/aarch64/gdbstub/test-mte.py
  4. 1
      tests/tcg/aarch64/gdbstub/test-sve-ioctl.py
  5. 1
      tests/tcg/aarch64/gdbstub/test-sve.py
  6. 1
      tests/tcg/multiarch/gdbstub/interrupt.py
  7. 1
      tests/tcg/multiarch/gdbstub/memory.py
  8. 1
      tests/tcg/multiarch/gdbstub/sha1.py
  9. 1
      tests/tcg/multiarch/gdbstub/test-proc-mappings.py
  10. 1
      tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py
  11. 1
      tests/tcg/multiarch/gdbstub/test-qxfer-siginfo-read.py
  12. 1
      tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py
  13. 1
      tests/tcg/s390x/gdbstub/test-signals-s390x.py
  14. 1
      tests/tcg/s390x/gdbstub/test-svc.py

1
scripts/userfaultfd-wrlat.py

@ -17,7 +17,6 @@
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
from __future__ import print_function
from bcc import BPF
from ctypes import c_ushort, c_int, c_ulonglong
from time import sleep

1
tests/guest-debug/test_gdbstub.py

@ -1,7 +1,6 @@
"""Helper functions for gdbstub testing
"""
from __future__ import print_function
import argparse
import gdb
import os

1
tests/tcg/aarch64/gdbstub/test-mte.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test GDB memory-tag commands that exercise the stubs for the qIsAddressTagged,
# qMemTag, and QMemTag packets, which are used for manipulating allocation tags.

1
tests/tcg/aarch64/gdbstub/test-sve-ioctl.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test the SVE ZReg reports the right amount of data. It uses the
# sve-ioctl test and examines the register data each time the

1
tests/tcg/aarch64/gdbstub/test-sve.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test the SVE registers are visible and changeable via gdbstub
#

1
tests/tcg/multiarch/gdbstub/interrupt.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test some of the system debug features with the multiarch memory
# test. It is a port of the original vmlinux focused test case but

1
tests/tcg/multiarch/gdbstub/memory.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test some of the system debug features with the multiarch memory
# test. It is a port of the original vmlinux focused test case but

1
tests/tcg/multiarch/gdbstub/sha1.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# A very simple smoke test for debugging the SHA1 userspace test on
# each target.

1
tests/tcg/multiarch/gdbstub/test-proc-mappings.py

@ -1,7 +1,6 @@
"""Test that gdbstub has access to proc mappings.
This runs as a sourced script (via -x, via run-test.py)."""
from __future__ import print_function
import gdb
from test_gdbstub import gdb_exit, main, report

1
tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test auxiliary vector is loaded via gdbstub
#

1
tests/tcg/multiarch/gdbstub/test-qxfer-siginfo-read.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test gdbstub Xfer:siginfo:read stub.
#

1
tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test auxiliary vector is loaded via gdbstub
#

1
tests/tcg/s390x/gdbstub/test-signals-s390x.py

@ -1,4 +1,3 @@
from __future__ import print_function
#
# Test that signals and debugging mix well together on s390x.

1
tests/tcg/s390x/gdbstub/test-svc.py

@ -1,7 +1,6 @@
"""Test single-stepping SVC.
This runs as a sourced script (via -x, via run-test.py)."""
from __future__ import print_function
import gdb
from test_gdbstub import main, report

Loading…
Cancel
Save