mirror of
https://github.com/RPCSX/xed.git
synced 2026-01-31 01:05:17 +01:00
elf_sizes: Popen() universal_newlines and exception syntax (linux)
Change-Id: I9bd658ba6c1ec82c28cd062a9118b74d2a9dd66e (cherry picked from commit e93dabbc58bcb2c4a93c0eac34d6c5cfc9d1195a)
This commit is contained in:
@@ -39,11 +39,12 @@ def _run_cmd(cmd, die_on_errors=True):
|
|||||||
sub = subprocess.Popen(cmd,
|
sub = subprocess.Popen(cmd,
|
||||||
shell=True,
|
shell=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT,
|
||||||
|
universal_newlines=True)
|
||||||
lines = sub.stdout.readlines()
|
lines = sub.stdout.readlines()
|
||||||
sub.wait()
|
sub.wait()
|
||||||
return (sub.returncode, lines)
|
return (sub.returncode, lines)
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
msg = "Execution failed for:" + str( cmd) + ".\nResult is " + str(e)
|
msg = "Execution failed for:" + str( cmd) + ".\nResult is " + str(e)
|
||||||
if die_on_errors:
|
if die_on_errors:
|
||||||
_die(msg)
|
_die(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user