[PATCH] scripts/igt_doc: fix a deprecation warning

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed Jul 16 11:48:47 UTC 2025


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

Regards,
Kamil

>                      if result != run_type:
>                          driver_set = set([driver])
>                          run_type = result
> -- 
> 2.50.0
> 


More information about the igt-dev mailing list