Skip to content

Commit c93e833

Browse files
committed
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 <[email protected]>
1 parent b1e602d commit c93e833

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ivtest/run_ivl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_ivl_version () -> list:
3333

3434
# Get the output from the "iverilog -V" command for the version string.
3535
text = subprocess.check_output(["iverilog", "-V"])
36-
match = re.search(b'Icarus Verilog version ([0-9]+)\.([0-9]+)', text)
36+
match = re.search(b'Icarus Verilog version ([0-9]+)\\.([0-9]+)', text)
3737
if not match:
3838
return None
3939

0 commit comments

Comments
 (0)