Skip to content

Commit

Permalink
Updated a regext to be more secure.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjrichardwebster committed Dec 13, 2024
1 parent 8441df4 commit 57e094a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def parse_snapshot_to_numpy_no_eval(self, snapshot: str) -> tuple[np.ndarray]:
snapshot = "\n".join(line for line in snapshot.splitlines() if not line.strip().startswith("#"))

# Extract array strings using regex
array_pattern = r"array\((\[.*?\])\)"
array_pattern = r"array\((\[[^\]]*\])\)"
matches = re.findall(array_pattern, snapshot, flags=re.S)

# Parse each array string into a NumPy array
Expand Down

0 comments on commit 57e094a

Please sign in to comment.