summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/python')
-rw-r--r--tools/lib/python/abi/abi_regex.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/lib/python/abi/abi_regex.py b/tools/lib/python/abi/abi_regex.py
index d0c5e3ede6b5..69d8507b7382 100644
--- a/tools/lib/python/abi/abi_regex.py
+++ b/tools/lib/python/abi/abi_regex.py
@@ -155,7 +155,7 @@ class AbiRegex(AbiParser):
if self.search_string:
if what.find(self.search_string) >= 0:
print(f"What: {what}")
- except re.PatternError:
+ except re.error:
self.log.warning("Ignoring '%s' as it produced an invalid regex:\n"
" '%s'", what, new)
@@ -194,7 +194,7 @@ class AbiRegex(AbiParser):
try:
self.re_string = re.compile(self.search_string)
- except re.PatternError as e:
+ except re.error as e:
msg = f"{self.search_string} is not a valid regular expression"
raise ValueError(msg) from e
@@ -223,9 +223,9 @@ class AbiRegex(AbiParser):
for r, s in self.re_whats:
try:
new = r.sub(s, new)
- except re.PatternError as e:
+ except re.error as e:
# Help debugging troubles with new regexes
- raise re.PatternError(f"{e}\nwhile re.sub('{r.pattern}', {s}, str)") from e
+ raise re.error(f"{e}\nwhile re.sub('{r.pattern}', {s}, str)") from e
v["regex"].append(new)