Skip to content

Commit

Permalink
src: resolve deprecation warnings for sre_constants (#7460)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxXor committed May 16, 2024
1 parent 6709625 commit e21159a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/opnsense/scripts/suricata/queryAlertLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import sys
import os.path
import re
import sre_constants
import shlex
import ujson
sys.path.insert(0, "/usr/local/opnsense/site-python")
Expand Down Expand Up @@ -73,7 +72,7 @@
filter_regexp = filter_regexp.lower()
try:
data_filters_comp[filterField] = re.compile(filter_regexp)
except sre_constants.error:
except re.error:
# remove illegal expression
# del data_filters[filterField]
data_filters_comp[filterField] = re.compile('.*')
Expand Down
3 changes: 1 addition & 2 deletions src/opnsense/scripts/syslog/queryLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import sys
import os.path
import re
import sre_constants
import ujson
import datetime
import glob
Expand Down Expand Up @@ -82,7 +81,7 @@
# no wildcard operator, assume partial match
filter = ".*%s.*" % filter
filter_regexp = re.compile(filter)
except sre_constants.error:
except re.error:
# remove illegal expression
filter_regexp = re.compile('.*')

Expand Down

0 comments on commit e21159a

Please sign in to comment.