Skip to content

Commit

Permalink
flake8: address errors in replace.py
Browse files Browse the repository at this point in the history
This addresses some flake8 errors (W605, E501) in
`maint-lib/stagelib/replace.py`

Signed-off-by: Guillaume Abrioux <[email protected]>
  • Loading branch information
guits committed Aug 10, 2023
1 parent 698394b commit aa288e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions maint-lib/stagelib/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Support __VARIABLE__ file replacement for variables matching '__<VARIABLE_NAME>__'.
# Support only variables with capital letters and underscores.
VARIABLE_FILE_PATTERN = re.compile('\_\_[A-Z\_0-9]+\_\_')
VARIABLE_FILE_PATTERN = re.compile(r'\_\_[A-Z\_0-9]+\_\_')

# Support global variable replacement for variables matching format
# '__ENV_[<GLOBAL_VAR_NAME>]__'. Support only globals w/ capital letters and underscores
Expand Down Expand Up @@ -124,7 +124,8 @@ def do_variable_replace(replace_root_dir):
for f in files:
# do not process the tarball
# this prevents the following error:
# UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
# UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in
# position 1: invalid start byte
if "Sree-" in f:
continue
if re.match(VARIABLE_FILE_PATTERN, f):
Expand Down

0 comments on commit aa288e7

Please sign in to comment.