]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests, scripts: Don't import print_function from __future__
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Sep 2025 12:14:15 +0000 (13:14 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 16 Sep 2025 16:31:53 +0000 (17:31 +0100)
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

14 files changed:
scripts/userfaultfd-wrlat.py
tests/guest-debug/test_gdbstub.py
tests/tcg/aarch64/gdbstub/test-mte.py
tests/tcg/aarch64/gdbstub/test-sve-ioctl.py
tests/tcg/aarch64/gdbstub/test-sve.py
tests/tcg/multiarch/gdbstub/interrupt.py
tests/tcg/multiarch/gdbstub/memory.py
tests/tcg/multiarch/gdbstub/sha1.py
tests/tcg/multiarch/gdbstub/test-proc-mappings.py
tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py
tests/tcg/multiarch/gdbstub/test-qxfer-siginfo-read.py
tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py
tests/tcg/s390x/gdbstub/test-signals-s390x.py
tests/tcg/s390x/gdbstub/test-svc.py

index 0684be4e04487e8a39aad8cc0e4531dd3d8cbb1c..a61a9abbfcb25e95a9f4428b7574de8167e78adc 100755 (executable)
@@ -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
index 4f08089e6a982a289ab26d6c7e03528e7c934597..e017ccb55d790572a727e918015a962385cbd535 100644 (file)
@@ -1,7 +1,6 @@
 """Helper functions for gdbstub testing
 
 """
-from __future__ import print_function
 import argparse
 import gdb
 import os
index 9ad98e7a54c845e580a1e1ee35c0399526841ed6..f4a7d7b4465018d04aa69c4157addf37bb67ceff 100644 (file)
@@ -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.
index a78a3a2514da28b1d09ca36f08e93fb21d7f58cd..2c5c2180319f4f6f130360bac4bac7a1ece94fd4 100644 (file)
@@ -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
index 84cdcd4a32ea1a8b3c42bab9cb84a5296b2acbf0..7b0489a622b8f166f338227216ede02bddc95be7 100644 (file)
@@ -1,4 +1,3 @@
-from __future__ import print_function
 #
 # Test the SVE registers are visible and changeable via gdbstub
 #
index 2d5654d15402541e88c4416d33dc884ec625f31f..4eccdb41b9744bbe945dfdfbf56b22a6ae508055 100644 (file)
@@ -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
index 532b92e7fb31e0ff0b4dca3cea622c714f7ce643..76d75e52512edeb6f2911ac8ff6a39f7f62b37d8 100644 (file)
@@ -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
index 1ce711a402ced663bd3085fbfa701df09a62e61f..3403b82fd4a77cdad2b191523a0fbee5b80f4d97 100644 (file)
@@ -1,4 +1,3 @@
-from __future__ import print_function
 #
 # A very simple smoke test for debugging the SHA1 userspace test on
 # each target.
index 6eb6ebf7b170be580c72c6339cbded0001ecd3e9..796dca75f0cb81b312b6af9e39719c94ed278f3b 100644 (file)
@@ -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
 
index 00c26ab4a9567a789ce3061b43e6cc2f72dbee51..fa36c943d6681ad9c199e2a434a53d80716abaa6 100644 (file)
@@ -1,4 +1,3 @@
-from __future__ import print_function
 #
 # Test auxiliary vector is loaded via gdbstub
 #
index 862596b07a765c9adef7bffbddad0a7e35381d17..b18fa1234fb5429f3ad12d2ecb29a57a9faaf076 100644 (file)
@@ -1,4 +1,3 @@
-from __future__ import print_function
 #
 # Test gdbstub Xfer:siginfo:read stub.
 #
index 4d6b6b9fbe7b563ef880f0d953cd2179cb6e0051..49cbc3548f6076a6a6fc7e84385774b5f7e41559 100644 (file)
@@ -1,4 +1,3 @@
-from __future__ import print_function
 #
 # Test auxiliary vector is loaded via gdbstub
 #
index b6b7b39fc46dc0b1ebd5942a0adcb085622d37c8..398ad534ebf6c6478e2f8ff618103c5e61ae45af 100644 (file)
@@ -1,4 +1,3 @@
-from __future__ import print_function
 
 #
 # Test that signals and debugging mix well together on s390x.
index 17210b4e02083169883825fc1e9c200c58802b55..29a0aa0ede45317e2e46e251d54edade058c64b3 100644 (file)
@@ -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