py3port: use encode() and decode() where applicable
This commit is contained in:
parent
46f44b645b
commit
04329b6757
28 changed files with 143 additions and 152 deletions
|
|
@ -19,7 +19,7 @@ cmd_args = opts.init(opts_data)
|
|||
|
||||
lines = get_lines_from_file(cmd_args[0])
|
||||
start = (1,0)[bool(opt.include_first_line)]
|
||||
a = make_chksum_6(' '.join(lines[start:]).encode('utf8'))
|
||||
a = make_chksum_6(' '.join(lines[start:]).encode())
|
||||
if start == 1:
|
||||
b = lines[0]
|
||||
msg(("Checksum in file ({}) doesn't match computed value!".format(b),'Checksum in file OK')[a==b])
|
||||
|
|
|
|||
|
|
@ -174,8 +174,8 @@ def compile_code(code):
|
|||
cmd = ['solc','--optimize','--bin','--overwrite']
|
||||
if not opt.stdout: cmd += ['--output-dir', opt.outdir or '.']
|
||||
p = Popen(cmd,stdin=PIPE,stdout=PIPE,stderr=PIPE)
|
||||
res = p.communicate(code)
|
||||
o = res[0].replace('\r','').split('\n')
|
||||
res = p.communicate(code.encode())
|
||||
o = res[0].decode().replace('\r','').split('\n')
|
||||
dmsg(res[1])
|
||||
if opt.stdout:
|
||||
return dict((k,o[i+2]) for k in ('SafeMath','Owned','Token') for i in range(len(o)) if k in o[i])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue