[libcamera-devel] [PATCH] utils: ipc: mojom_libcamera_generator.py: Fix Python warning

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Jan 9 13:44:03 CET 2024


Quoting Milan Zamazal via libcamera-devel (2024-01-05 13:16:21)
> Python 3.12 starts emitting the following warning when building libcamera:
> 
>   .../utils/ipc/generators/mojom_libcamera_generator.py:372:
>   SyntaxWarning: invalid escape sequence '\.'
>     if not re.match('^ipa\.[0-9A-Za-z_]+', namespace):
> 
> `r' prefix is now required before the regexp.
> 
> Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
> ---
>  utils/ipc/generators/mojom_libcamera_generator.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/generators/mojom_libcamera_generator.py
> index 1a629f9d..582818c9 100644
> --- a/utils/ipc/generators/mojom_libcamera_generator.py
> +++ b/utils/ipc/generators/mojom_libcamera_generator.py
> @@ -369,7 +369,7 @@ def ValidateNamespace(namespace):
>      if namespace == '':
>          raise Exception('Must have a namespace')
>  
> -    if not re.match('^ipa\.[0-9A-Za-z_]+', namespace):
> +    if not re.match(r'^ipa\.[0-9A-Za-z_]+', namespace):

This looks reasonable to me.

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

>          raise Exception('Namespace must be of the form "ipa.{pipeline_name}"')
>  
>  def ValidateInterfaces(interfaces):
> -- 
> 2.42.0
>


More information about the libcamera-devel mailing list