generate_component_general: ensure string is a regex literal

Fixes the Python warning:
SyntaxWarning: invalid escape sequence '\s'

It was still working correctly before.
This commit is contained in:
Beat Küng 2023-12-06 10:02:17 +01:00
parent 37f24a17eb
commit d632a42be5
No known key found for this signature in database
GPG Key ID: 866DB5F0E24821BB
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ version_file = args.version_file
version_dir = ''
if version_file is not None:
for line in open(version_file, "r"):
version_search = re.search('PX4_GIT_TAG_OR_BRANCH_NAME\s+"(.+)"', line)
version_search = re.search(r'PX4_GIT_TAG_OR_BRANCH_NAME\s+"(.+)"', line)
if version_search:
version_dir = version_search.group(1)
break