Skip to content

Commit 542c719

Browse files
authored
Strip extra whitespace from solc arguments (#242)
This was causing issues with options such as "--foo xyz --bar baz" as they were being parsed as ["--foo", "xyz ", "--bar", "baz"] (note the extra space). This becomes problematic when the arguments are filesystem paths.
1 parent 2279686 commit 542c719

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crytic_compile/platform/solc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def _run_solc(
489489
# split() removes the delimiter, so we add it again
490490
solc_args_ = [("--" + x).split(" ", 1) for x in solc_args if x]
491491
# Flat the list of list
492-
solc_args = [item for sublist in solc_args_ for item in sublist if item]
492+
solc_args = [item.strip() for sublist in solc_args_ for item in sublist if item]
493493
cmd += solc_args
494494

495495
additional_kwargs: Dict = {"cwd": working_dir} if working_dir else {}

0 commit comments

Comments
 (0)