diff --git a/scripts/MBIutils.py b/scripts/MBIutils.py
index e19e04eb77b9590f6e65da343b35dfa80cfadad4..14d3987651e15e0428b9ad2d5ce93685f9ac9e8a 100644
--- a/scripts/MBIutils.py
+++ b/scripts/MBIutils.py
@@ -308,7 +308,7 @@ def parse_one_code(filename):
                     state = 2
                 else:
                     raise ValueError(f"Unexpected end of MBB_TESTS header at line {line_num}: \n{line}")
-            elif re.match("This testcase can result in a Deadlock", line):
+            elif "This testcase can result in a Deadlock" in line:
                 can_deadlock = True
             if state == 1 and re.match("\s+\$ ?.*", line):
                 m = re.match('\s+\$ ?(.*)', line)