From c93e8334a284f5789356f4903bc17526ddb9c7f8 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 14 Jan 2024 17:16:39 -0800 Subject: [PATCH] run_ivl.py: Properly escape `.` in regex To escape the `.` in the regex it needs to be prefixed with a `\`. But since the `\` is a escape character in python strings it needs to be escaped as well. Without this some versions of python print the following warning: run_ivl.py:36: SyntaxWarning: invalid escape sequence '\.' match= re.search(b'Icarus Verilog version ([0-9]+)\.([0-9]+)', text) Signed-off-by: Lars-Peter Clausen --- ivtest/run_ivl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivtest/run_ivl.py b/ivtest/run_ivl.py index 8753a6340..8d0b2f965 100644 --- a/ivtest/run_ivl.py +++ b/ivtest/run_ivl.py @@ -33,7 +33,7 @@ def get_ivl_version () -> list: # Get the output from the "iverilog -V" command for the version string. text = subprocess.check_output(["iverilog", "-V"]) - match = re.search(b'Icarus Verilog version ([0-9]+)\.([0-9]+)', text) + match = re.search(b'Icarus Verilog version ([0-9]+)\\.([0-9]+)', text) if not match: return None