fixed os.path.join

pull/50/head
step21 7 years ago
parent 56ca0ba4b4
commit 5403fc9148
  1. 18
      myth
  2. 2
      mythril/ether/util.py

18
myth

@ -159,23 +159,25 @@ if args.solv:
solc_binary = 'solc'
else:
if util.solc_exists(version):
solc_binary = os.join(os.environ['HOME'], "/.py-solc/solc-v", version, "/bin/solc")
print('Given version is already installed')
solc_binary = os.path.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.join(os.environ['HOME'], "/.py-solc/solc-v", version, "/bin/solc")
solc_binary = os.path.join(os.environ['HOME'], ".py-solc/solc-v" + version, "bin/solc")
print("Setting the compiler to " + str(solc_binary))
except SolcError:
exitWithError("There was an error when trying to install the specified solc version")
else:
try:
solc_binary = os.environ['SOLC']
except KeyError:
if not args.solv:
try:
solc_binary = 'solc'
except:
exitWithError('No solidity compiler found, please make sure it is installed or specify it manually.')
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

@ -65,7 +65,7 @@ def get_indexed_address(index):
return "0x" + (hex(index)[2:] * 40)
def solc_exists(version):
solc_binary = os.join(os.environ['HOME'], "/.py-solc/solc-v", version, "/bin/solc")
solc_binary = os.path.join(os.environ['HOME'], ".py-solc/solc-v" + version, "bin/solc")
if os.path.exists(solc_binary):
return True
else:

Loading…
Cancel
Save