Skip to content

Commit

Permalink
Raise exception when compiler version is not supported by solc-select
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush committed Dec 30, 2021
1 parent 4d35e4b commit 1ca8698
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crytic_compile/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

LOGGER = logging.getLogger("CryticCompile")

class UnsupportedSolcVersion(Exception):
pass

# pylint: disable=too-few-public-methods
class CompilerVersion:
"""
Expand Down Expand Up @@ -45,8 +48,10 @@ def look_for_installed_version(self) -> None:
try:
from solc_select import solc_select

if self.version not in solc_select.installed_versions():
if self.version not in solc_select.installed_versions() and self.version in solc_select.get_available_versions():
solc_select.install_artifacts([self.version])
else:
raise UnsupportedSolcVersion(f"{self.version} is not supported by solc-select")

except ImportError:
LOGGER.info(
Expand Down

0 comments on commit 1ca8698

Please sign in to comment.