Use raw string to avoid unintended escapes in regex (#5676)

This commit is contained in:
Zheng Shaokun 2024-05-21 23:34:06 +08:00 committed by GitHub
parent 14fe558c07
commit e4b1a48aab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,7 +78,7 @@ def git_executable():
minor=None
try:
version_info = subprocess.check_output([git, '--version']).decode('utf-8')
match = re.search("^git version (\d+)\.(\d+)",version_info)
match = re.search(r"^git version (\d+)\.(\d+)",version_info)
print("Using {}".format(version_info))
if match:
major = int(match.group(1))