Fix issue #1702 (crash without internet) (#1703)

* Fix issue #1702 (crash without internet)

* Use ConnectionError

Co-authored-by: norhh <nikhilparasaram@gmail.com>
pull/1705/head
gsalzer 2 years ago committed by GitHub
parent 009a5dedab
commit e18dec4449
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      mythril/ethereum/util.py

@ -10,6 +10,7 @@ import solc
import re
from pathlib import Path
from requests.exceptions import ConnectionError
from subprocess import PIPE, Popen
from typing import Optional
@ -139,7 +140,11 @@ def solc_exists(version):
return solc_binary
all_versions = solcx.get_installable_solc_versions()
try:
all_versions = solcx.get_installable_solc_versions()
except ConnectionError:
# No internet, trying to proceed with installed compilers
all_versions = solcx.get_installed_solc_versions()
def extract_version(file: str) -> Optional[str]:

Loading…
Cancel
Save