Skip to content

Commit

Permalink
Use expression = rf"^{regex}" - f-string is better!
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaozhou Li committed Sep 6, 2021
1 parent 204aa63 commit c6c08c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Charon/filetypes/OpenPackagingConvention.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _processAliases(self, virtual_path: str) -> str:
# Replace all aliases.
for regex, replacement in self._aliases.items():
if regex.startswith("/"):
expression = r"^" + regex
expression = rf"^{regex}"
else:
expression = regex
virtual_path = re.sub(expression, replacement, virtual_path)
Expand Down

0 comments on commit c6c08c8

Please sign in to comment.