From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Jon Hunter <jonathanh@nvidia.com>,
Rob Clark <robdclark@gmail.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: <linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>, <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH] drm/msm: Fix gen_header.py for python earlier than v3.9
Date: Wed, 8 May 2024 09:46:04 -0700 [thread overview]
Message-ID: <83b6e1aa-c8ec-0bd7-2c98-20705741b76a@quicinc.com> (raw)
In-Reply-To: <20240508091751.336654-1-jonathanh@nvidia.com>
On 5/8/2024 2:17 AM, Jon Hunter wrote:
> Building the kernel with python3 versions earlier than v3.9 fails with ...
>
> Traceback (most recent call last):
> File "drivers/gpu/drm/msm/registers/gen_header.py", line 970, in <module>
> main()
> File "drivers/gpu/drm/msm/registers/gen_header.py", line 951, in main
> parser.add_argument('--validate', action=argparse.BooleanOptionalAction)
> AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction'
>
> The argparse attribute 'BooleanOptionalAction' is only supported for
> python v3.9 and later. Fix support for earlier python3 versions by
> explicitly defining '--validate' and '--no-validate' arguments.
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> drivers/gpu/drm/msm/registers/gen_header.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Thanks for your patch, I had sent something similar y'day.
If you are alright with https://patchwork.freedesktop.org/patch/593057/,
we can use that one.
> diff --git a/drivers/gpu/drm/msm/registers/gen_header.py b/drivers/gpu/drm/msm/registers/gen_header.py
> index fc3bfdc991d2..64f67d2e3f1c 100644
> --- a/drivers/gpu/drm/msm/registers/gen_header.py
> +++ b/drivers/gpu/drm/msm/registers/gen_header.py
> @@ -948,7 +948,8 @@ def main():
> parser = argparse.ArgumentParser()
> parser.add_argument('--rnn', type=str, required=True)
> parser.add_argument('--xml', type=str, required=True)
> - parser.add_argument('--validate', action=argparse.BooleanOptionalAction)
> + parser.add_argument('--validate', dest='validate', action='store_true')
> + parser.add_argument('--no-validate', dest='validate', action='store_false')
>
> subparsers = parser.add_subparsers()
> subparsers.required = True
next prev parent reply other threads:[~2024-05-08 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 9:17 [PATCH] drm/msm: Fix gen_header.py for python earlier than v3.9 Jon Hunter
2024-05-08 16:46 ` Abhinav Kumar [this message]
2024-05-08 20:52 ` Jon Hunter
2024-05-30 13:17 ` Jon Hunter
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=83b6e1aa-c8ec-0bd7-2c98-20705741b76a@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jonathanh@nvidia.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=robdclark@gmail.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).