Skip to content

Commit

Permalink
SyntaxWarning on three regex expressions.
Browse files Browse the repository at this point in the history
To resolve "SyntaxWarning: invalid escape sequence '\('" with Python 3.12.4.
tianocore#251

Signed-off-by: Nathaniel Haller <[email protected]>
  • Loading branch information
ndhaller committed Jun 19, 2024
1 parent dbcbb95 commit 54057d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion edkrepo/commands/sync_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def __check_submodule_config(self, workspace_path, manifest, repo_sources):
try:
local_manifest_dir = os.path.join(workspace_path, "repo")
prefix_required = find_git_version() >= GitVersion('2.34.0')
includeif_regex = re.compile('^includeIf "gitdir:{}(/.+)/"$'.format('%\(prefix\)' if prefix_required else ''))
includeif_regex = re.compile('^includeIf "gitdir:{}(/.+)/"$'.format('%\\(prefix\\)' if prefix_required else ''))
rewrite_everything = False
#Generate list of .gitconfig files that should be present in the workspace
included_configs = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def clean_git_globalconfig():
prefix_required = find_git_version() >= GitVersion('2.34.0')
with git.GitConfigParser(global_gitconfig_path, read_only=False) as git_globalconfig:
if prefix_required:
includeif_regex = re.compile('^includeIf "gitdir:%\(prefix\)(/.+)/"$')
includeif_regex = re.compile('^includeIf "gitdir:%\\(prefix\\)(/.+)/"$')
includeif_regex_old = re.compile('^includeIf "gitdir:(/.+)/"$')
else:
includeif_regex_old = re.compile('^includeIf "gitdir:%\(prefix\)(/.+)/"$')
includeif_regex_old = re.compile('^includeIf "gitdir:%\\(prefix\\)(/.+)/"$')
includeif_regex = re.compile('^includeIf "gitdir:(/.+)/"$')
for section in git_globalconfig.sections():
data = includeif_regex.match(section)
Expand Down

0 comments on commit 54057d1

Please sign in to comment.