Skip to content

Commit

Permalink
fix for #671 wrap regcomp in try/except to clearly deal with bad rege…
Browse files Browse the repository at this point in the history
…xes.
  • Loading branch information
petersilva authored and MagikEh committed May 29, 2023
1 parent 561fdd6 commit b0ae154
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sarracenia/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,12 @@ def _varsub(self, word):
def _build_mask(self, option, arguments):
""" return new entry to be appended to list of masks
"""
regex = re.compile(arguments[0])
try:
regex = re.compile(arguments[0])
except:
logger.critical( f"invalid regular expression: {arguments[0]}, ignored." )
return None

if len(arguments) > 1:
fn = arguments[1]
else:
Expand Down

0 comments on commit b0ae154

Please sign in to comment.