Re: [PATCH] perf test: Replace optparse with argparse in attr.py

From: Leo Yan

Date: Fri Oct 02 2026 - 03:57:24 EST


On Thu, Oct 01, 2026 at 09:20:20AM -0700, Ian Rogers wrote:
> On Thu, Oct 1, 2026 at 8:52 AM Leo Yan <leo.yan@xxxxxxx> wrote:
> >
> > Depending on the Python and pylint versions, pylint can report that
> > optparse is deprecated and fail the lint check. Use argparse to avoid
> > this potential warning.
> >
> > Preserve the existing options and defaults, and let argparse handle
> > help and unexpected positional arguments.
> >
> > Tested with:
> >
> > # ./perf test -v 'Perf attribute expectations test'
> > 78: Perf attribute expectations test : Ok
> >
> > Suggested-by: Ian Rogers <irogers@xxxxxxxxxx>
> > Signed-off-by: Leo Yan <leo.yan@xxxxxxx>
>
> Hi Leo, thanks for the fix! I see Arnaldo already took this equivalent change:
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/commit/?h=tmp.perf-tools-next&id=cd116fcbc0bec7340a659e62210b963c49f93c1e
>
> Sorry for the extra work, but again thanks!

It is fine, thanks let me know.