Merge pull request #976 from emmanuel-ferdman/dev

Resolve deprecation warnings of regex library
This commit is contained in:
jdegenstein 2025-04-29 14:27:14 -05:00 committed by GitHub
commit db2ec675fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -49,7 +49,7 @@ class TestAssembly(unittest.TestCase):
actual_topo_lines = actual_topo.splitlines()
self.assertEqual(len(actual_topo_lines), len(expected_topo_lines))
for actual_line, expected_line in zip(actual_topo_lines, expected_topo_lines):
start, end = re.split(r"at 0x[0-9a-f]+,", expected_line, 2, re.I)
start, end = re.split(r"at 0x[0-9a-f]+,", expected_line, maxsplit=2, flags=re.I)
self.assertTrue(actual_line.startswith(start))
self.assertTrue(actual_line.endswith(end))

View file

@ -64,14 +64,14 @@ class TestShapeList(unittest.TestCase):
actual_lines = actual.splitlines()
self.assertEqual(len(actual_lines), len(expected_lines))
for actual_line, expected_line in zip(actual_lines, expected_lines):
start, end = re.split(r"at 0x[0-9a-f]+", expected_line, 2, re.I)
start, end = re.split(r"at 0x[0-9a-f]+", expected_line, maxsplit=2, flags=re.I)
self.assertTrue(actual_line.startswith(start))
self.assertTrue(actual_line.endswith(end))
def assertDunderReprEqual(self, actual: str, expected: str):
splitter = r"at 0x[0-9a-f]+"
actual_split_list = re.split(splitter, actual, 0, re.I)
expected_split_list = re.split(splitter, expected, 0, re.I)
actual_split_list = re.split(splitter, actual, maxsplit=0, flags=re.I)
expected_split_list = re.split(splitter, expected, maxsplit=0, flags=re.I)
for actual_split, expected_split in zip(actual_split_list, expected_split_list):
self.assertEqual(actual_split, expected_split)