mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8169 from imapp-pl/fix-str-bytes-mismatch-in-prepare-report-py
Fix str/bytes mismatch crashing prepare_report.py when running storebytecode.sh
This commit is contained in:
commit
5ccfaf8c10
@ -6,7 +6,7 @@ import subprocess
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
SOLC_BIN = sys.argv[1]
|
SOLC_BIN = sys.argv[1]
|
||||||
REPORT_FILE = open("report.txt", "wb")
|
REPORT_FILE = open("report.txt", "w")
|
||||||
|
|
||||||
for optimize in [False, True]:
|
for optimize in [False, True]:
|
||||||
for f in sorted(glob.glob("*.sol")):
|
for f in sorted(glob.glob("*.sol")):
|
||||||
@ -26,9 +26,9 @@ for optimize in [False, True]:
|
|||||||
if optimize:
|
if optimize:
|
||||||
args += ['--optimize']
|
args += ['--optimize']
|
||||||
proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
(out, err) = proc.communicate(json.dumps(input_json))
|
(out, err) = proc.communicate(json.dumps(input_json).encode('utf-8'))
|
||||||
try:
|
try:
|
||||||
result = json.loads(out.strip())
|
result = json.loads(out.decode('utf-8').strip())
|
||||||
for filename in sorted(result['contracts'].keys()):
|
for filename in sorted(result['contracts'].keys()):
|
||||||
for contractName in sorted(result['contracts'][filename].keys()):
|
for contractName in sorted(result['contracts'][filename].keys()):
|
||||||
contractData = result['contracts'][filename][contractName]
|
contractData = result['contracts'][filename][contractName]
|
||||||
|
Loading…
Reference in New Issue
Block a user