removed semver, used os-path.join, more correct and robust checking for compiler

pull/50/head
step21 7 years ago
parent 97c3384943
commit b4968b9732
  1. 15
      myth

15
myth

@ -23,7 +23,6 @@ from ethereum import utils
from pathlib import Path
from json.decoder import JSONDecodeError
from solc.exceptions import SolcError
import semantic_version
import solc
import logging
import json
@ -160,15 +159,23 @@ if args.solv:
solc_binary = 'solc'
else:
if util.solc_exists(version):
solc_binary = os.environ['HOME'] + "/.py-solc/solc-v" + version + "/bin/solc"
solc_binary = os.join(os.environ['HOME'], "/.py-solc/solc-v", version, "/bin/solc")
print("Setting the compiler to " + str(solc_binary))
else:
try:
solc.install_solc('v' + version)
solc_binary = os.environ['HOME'] + "/.py-solc/solc-v" + version + "/bin/solc"
solc_binary = os.join(os.environ['HOME'], "/.py-solc/solc-v", version, "/bin/solc")
print("Setting the compiler to " + str(solc_binary))
except SolcError:
print("There was an error when trying to install the specified solc version")
exitWithError("There was an error when trying to install the specified solc version")
else:
try:
solc_binary = os.environ['SOLC']
except KeyError:
try:
solc_binary = 'solc'
except:
exitWithError('No solidity compiler found, please make sure it is installed or specify it manually.')
# Establish RPC/IPC connection if necessary

Loading…
Cancel
Save