Capture stderr

pull/22/head
Bernhard Mueller 7 years ago
parent 12e1e4c1f2
commit af8cb476a7
  1. 3
      myth
  2. 4
      mythril/ether/util.py

@ -14,7 +14,6 @@ from mythril.rpc.client import EthJsonRpc
from mythril.ipc.client import EthIpc
from ethereum import utils
from laser.ethereum import laserfree
import yaml
import logging
import binascii
import sys
@ -131,7 +130,7 @@ if (args.code):
elif (args.address):
encoded_bytecode = eth.eth_getCode(args.address)
elif (args.infile):
encoded_bytecode = compile_solidity(args.infile)
encoded_bytecode = compile_solidity(solc_binary, args.infile)
else:
exitWithError("No input bytecode. Please provide EVM code via -c BYTECODE, -a ADDRESS, or -i SOLIDITY_FILE")

@ -12,8 +12,8 @@ def safe_decode(hex_encoded_string):
return bytes.fromhex(hex_encoded_string)
def compile_solidity(file):
output = subprocess.check_output(["solc", "--bin-runtime", file])
def compile_solidity(solc_binary, file):
output = subprocess.check_output(["solc", "--bin-runtime", file], stderr=subprocess.DEVNULL)
m = re.search(r"runtime part: \\n(.*)\\n", str(output))
return m.group(1)

Loading…
Cancel
Save