[PATCH] utils: ipc: extract-docs: Fix escape characters in regex
Nicolas Dufresne
nicolas at ndufresne.ca
Mon Jan 22 17:33:13 CET 2024
Le lundi 22 janvier 2024 à 20:01 +0900, Paul Elder a écrit :
> Newer versions of python now generate a SyntaxWarning (SyntaxError in
> the future [1]) for invalid escape sequences. Fix this, as there were
> invalid escape sequences in the regexes:
>
> "libcamera/utils/ipc/./extract-docs.py:13: SyntaxWarning: invalid escape
> sequence '\/'"
>
> [1] https://docs.python.org/3.12/library/re.html
>
> Reported-by: Nicolas Dufresne <nicolas at ndufresne.ca>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
No more warnings, thanks,
Tested-by: Nicolas Dufresne <nicolas.dufresne at collabora.com>
>
> ---
> I'm not actually able to reproduce the warning in the first place, but
> from my understanding this should fix the problem. Nicolas, could you
> confirm this please?
> ---
> utils/ipc/extract-docs.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/utils/ipc/extract-docs.py b/utils/ipc/extract-docs.py
> index 8f7fff9ff..c2050c998 100755
> --- a/utils/ipc/extract-docs.py
> +++ b/utils/ipc/extract-docs.py
> @@ -10,9 +10,9 @@ import argparse
> import re
> import sys
>
> -regex_block_start = re.compile('^\/\*\*$')
> -regex_block_end = re.compile('^ \*\/$')
> -regex_spdx = re.compile('^\/\* SPDX-License-Identifier: .* \*\/$')
> +regex_block_start = re.compile(r'^/\*\*$')
> +regex_block_end = re.compile(r'^ \*/$')
> +regex_spdx = re.compile(r'^/\* SPDX-License-Identifier: .* \*/$')
>
>
> def main(argv):
More information about the libcamera-devel
mailing list