From: Florian Schmaus Date: Tue, 20 Feb 2024 13:52:48 +0000 (-0500) Subject: pylibfdt: Fix "invalid escape sequence '\w'" in setup.py X-Git-Tag: accepted/tizen/unified/20240806.010530~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2b2d60af10ffe5e05e09bbccb12e8a365835907;p=platform%2Fkernel%2Fu-boot.git pylibfdt: Fix "invalid escape sequence '\w'" in setup.py Once u-boot's build system invokes python3 scripts/dtc/pylibfdt/setup.py --quiet build_ext --inplace it may fail with scripts/dtc/pylibfdt/setup.py:40: SyntaxWarning: invalid escape sequence '\w' RE_KEY_VALUE = re.compile('(?P\w+) *(?P[+])?= *(?P.*)$') depending on the used Python version. Explicitly mark the regex string as raw string to avoid the warning. Signed-off-by: Florian Schmaus Reviewed-by: Heinrich Schuchardt [sw0312.kim: cherry-pick upstream commit d4c84d7062ec to resolve script warning] Signed-off-by: Seung-Woo Kim Change-Id: I5b53521afea61a07fa36725cb9ceedb4545ee188 --- diff --git a/scripts/dtc/pylibfdt/setup.py b/scripts/dtc/pylibfdt/setup.py index 8baae08770..c6fe5a6a44 100755 --- a/scripts/dtc/pylibfdt/setup.py +++ b/scripts/dtc/pylibfdt/setup.py @@ -37,7 +37,7 @@ with open(os.path.join(srcdir, "../README"), "r") as fh: long_description = fh.read() # Decodes a Makefile assignment line into key and value (and plus for +=) -RE_KEY_VALUE = re.compile('(?P\w+) *(?P[+])?= *(?P.*)$') +RE_KEY_VALUE = re.compile(r'(?P\w+) *(?P[+])?= *(?P.*)$') def get_top_builddir(): if '--top-builddir' in sys.argv: