From: John Snow <jsnow@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
"Cleber Rosa" <crosa@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] tests, scripts: Don't import print_function from __future__
Date: Tue, 19 Aug 2025 17:30:38 -0400 [thread overview]
Message-ID: <CAFn=p-Y_-HEKWDrZeZjG5GLaM6dk6fRFHqGr9KCiL1ri+TaCnA@mail.gmail.com> (raw)
In-Reply-To: <20250819102409.2117969-1-peter.maydell@linaro.org>
On Tue, Aug 19, 2025 at 6:24 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> 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: John Snow <jsnow@redhat.com>
> ---
> scripts/userfaultfd-wrlat.py | 1 -
> tests/guest-debug/test_gdbstub.py | 1 -
> tests/tcg/aarch64/gdbstub/test-mte.py | 1 -
> tests/tcg/aarch64/gdbstub/test-sve-ioctl.py | 1 -
> tests/tcg/aarch64/gdbstub/test-sve.py | 1 -
> tests/tcg/multiarch/gdbstub/interrupt.py | 1 -
> tests/tcg/multiarch/gdbstub/memory.py | 1 -
> tests/tcg/multiarch/gdbstub/sha1.py | 1 -
> tests/tcg/multiarch/gdbstub/test-proc-mappings.py | 1 -
> tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py | 1 -
> tests/tcg/multiarch/gdbstub/test-qxfer-siginfo-read.py | 1 -
> tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py | 1 -
> tests/tcg/s390x/gdbstub/test-signals-s390x.py | 1 -
> tests/tcg/s390x/gdbstub/test-svc.py | 1 -
> 14 files changed, 14 deletions(-)
>
> diff --git a/scripts/userfaultfd-wrlat.py b/scripts/userfaultfd-wrlat.py
> index 0684be4e044..a61a9abbfcb 100755
> --- a/scripts/userfaultfd-wrlat.py
> +++ b/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
> diff --git a/tests/guest-debug/test_gdbstub.py b/tests/guest-debug/test_gdbstub.py
> index 4f08089e6a9..e017ccb55d7 100644
> --- a/tests/guest-debug/test_gdbstub.py
> +++ b/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
> diff --git a/tests/tcg/aarch64/gdbstub/test-mte.py b/tests/tcg/aarch64/gdbstub/test-mte.py
> index 9ad98e7a54c..f4a7d7b4465 100644
> --- a/tests/tcg/aarch64/gdbstub/test-mte.py
> +++ b/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.
> diff --git a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py b/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py
> index a78a3a2514d..2c5c2180319 100644
> --- a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py
> +++ b/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
> diff --git a/tests/tcg/aarch64/gdbstub/test-sve.py b/tests/tcg/aarch64/gdbstub/test-sve.py
> index 84cdcd4a32e..7b0489a622b 100644
> --- a/tests/tcg/aarch64/gdbstub/test-sve.py
> +++ b/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
> #
> diff --git a/tests/tcg/multiarch/gdbstub/interrupt.py b/tests/tcg/multiarch/gdbstub/interrupt.py
> index 2d5654d1540..4eccdb41b97 100644
> --- a/tests/tcg/multiarch/gdbstub/interrupt.py
> +++ b/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
> diff --git a/tests/tcg/multiarch/gdbstub/memory.py b/tests/tcg/multiarch/gdbstub/memory.py
> index 532b92e7fb3..76d75e52512 100644
> --- a/tests/tcg/multiarch/gdbstub/memory.py
> +++ b/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
> diff --git a/tests/tcg/multiarch/gdbstub/sha1.py b/tests/tcg/multiarch/gdbstub/sha1.py
> index 1ce711a402c..3403b82fd4a 100644
> --- a/tests/tcg/multiarch/gdbstub/sha1.py
> +++ b/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.
> diff --git a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py b/tests/tcg/multiarch/gdbstub/test-proc-mappings.py
> index 6eb6ebf7b17..796dca75f0c 100644
> --- a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py
> +++ b/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
>
> diff --git a/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py b/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py
> index 00c26ab4a95..fa36c943d66 100644
> --- a/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py
> +++ b/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
> #
> diff --git a/tests/tcg/multiarch/gdbstub/test-qxfer-siginfo-read.py b/tests/tcg/multiarch/gdbstub/test-qxfer-siginfo-read.py
> index 862596b07a7..b18fa1234fb 100644
> --- a/tests/tcg/multiarch/gdbstub/test-qxfer-siginfo-read.py
> +++ b/tests/tcg/multiarch/gdbstub/test-qxfer-siginfo-read.py
> @@ -1,4 +1,3 @@
> -from __future__ import print_function
> #
> # Test gdbstub Xfer:siginfo:read stub.
> #
> diff --git a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py b/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py
> index 4d6b6b9fbe7..49cbc3548f6 100644
> --- a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py
> +++ b/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py
> @@ -1,4 +1,3 @@
> -from __future__ import print_function
> #
> # Test auxiliary vector is loaded via gdbstub
> #
> diff --git a/tests/tcg/s390x/gdbstub/test-signals-s390x.py b/tests/tcg/s390x/gdbstub/test-signals-s390x.py
> index b6b7b39fc46..398ad534ebf 100644
> --- a/tests/tcg/s390x/gdbstub/test-signals-s390x.py
> +++ b/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.
> diff --git a/tests/tcg/s390x/gdbstub/test-svc.py b/tests/tcg/s390x/gdbstub/test-svc.py
> index 17210b4e020..29a0aa0ede4 100644
> --- a/tests/tcg/s390x/gdbstub/test-svc.py
> +++ b/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
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2025-08-19 21:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 10:24 [PATCH] tests, scripts: Don't import print_function from __future__ Peter Maydell
2025-08-19 11:30 ` Daniel P. Berrangé
2025-08-19 21:30 ` John Snow [this message]
2025-08-20 6:34 ` Philippe Mathieu-Daudé
2025-09-01 16:16 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFn=p-Y_-HEKWDrZeZjG5GLaM6dk6fRFHqGr9KCiL1ri+TaCnA@mail.gmail.com' \
--to=jsnow@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=crosa@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).