[PATCH] scripts/igt_doc: fix a deprecation warning
Kamil Konieczny
kamil.konieczny at linux.intel.com
Thu Jul 17 17:20:58 UTC 2025
Hi Ruhl,,
On 2025-07-16 at 12:20:30 +0000, Ruhl, Michael J wrote:
> >-----Original Message-----
> >From: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> >Sent: Wednesday, July 16, 2025 7:49 AM
> >To: Ruhl, Michael J <michael.j.ruhl at intel.com>
> >Cc: igt-dev at lists.freedesktop.org; De Marchi, Lucas
> ><lucas.demarchi at intel.com>; Vivi, Rodrigo <rodrigo.vivi at intel.com>
> >Subject: Re: [PATCH] scripts/igt_doc: fix a deprecation warning
> >
> >Hi Michael,
> >On 2025-07-15 at 12:24:36 -0400, Michael J. Ruhl wrote:
> >> The regular expression usage has count as the third parameter,
> >> which results in this error message:
> >>
> >> DeprecationWarning: 'count' is passed as positional argument
> >>
> >> So the current usage incorrectly uses the flag value as a count.
> >>
> >> Specify the parameter name to get the correct usage.
> >>
> >> Signed-off-by: Michael J. Ruhl <michael.j.ruhl at intel.com>
> >
> >Thank you, I already merged it but please see one nit below.
> >
> >> ---
> >> scripts/igt_doc.py | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
> >> index fa2c2c7ca..3a37a9701 100755
> >> --- a/scripts/igt_doc.py
> >> +++ b/scripts/igt_doc.py
> >> @@ -37,7 +37,7 @@ class IgtTestList(TestList):
> >> run_type = "other"
> >> else:
> >> for driver in self.drivers:
> >> - result = re.sub(r"^" + driver + r"[\W_]*", "", run_type,
> >re.IGNORECASE)
> >> + result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, flags =
> >re.IGNORECASE)
> >
> >According to Python doc, there should be also count=0:
> >
> >result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, count = 0, flags =
> >re.IGNORECASE)
> >
> >Please see: https://docs.python.org/3/library/re.html#re.sub
>
> Hi Kamil,
>
> My understanding was that that indicated that the default value of count/flags if they
> where not explicitly set.... Looking at the examples, I see they are setting flags, but not
> count.
>
> I can provide an update with count = 0, but it is not clear to me that that is required.
>
> Thoughts?
I am not python programmer, not sure if that AI suggestion is true.
After second reading of examples from above link I see there is
exactly same code you wrote, no count and flags only, so imho no
need for more changes.
Regards,
Kamil
>
> Mike
>
> >Regards,
> >Kamil
> >
> >> if result != run_type:
> >> driver_set = set([driver])
> >> run_type = result
> >> --
> >> 2.50.0
> >>
More information about the igt-dev
mailing list