Skip to content

Commit

Permalink
fix: issue where expected return code for help was wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Nov 9, 2023
2 parents 705c963 + d1bfce1 commit b6c2ef9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion solcx/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def solc_wrapper(
command: List = [str(solc_binary)]

if success_return_code is None:
success_return_code = 1 if "help" in kwargs else 0
if "help" in kwargs and solc_version < Version("0.8.10"):
success_return_code = 1
else:
success_return_code = 0

if source_files is not None:
if isinstance(source_files, (str, Path)):
Expand Down
5 changes: 4 additions & 1 deletion tests/test_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def setup(all_versions):

def test_help(popen):
popen.expect("help")
solcx.wrapper.solc_wrapper(help=True, success_return_code=1)
if solcx.get_solc_version() < Version("0.8.10"):
solcx.wrapper.solc_wrapper(help=True, success_return_code=1)
else:
solcx.wrapper.solc_wrapper(help=True, success_return_code=0)


@pytest.mark.parametrize(
Expand Down

0 comments on commit b6c2ef9

Please sign in to comment.