forked from mirrors/gecko-dev
Bug 1884392 - Remove six dependency from RunCbindgen.py r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D204050
This commit is contained in:
parent
10b922a0a2
commit
7796133100
1 changed files with 7 additions and 6 deletions
|
|
@ -7,7 +7,6 @@ import subprocess
|
||||||
|
|
||||||
import buildconfig
|
import buildconfig
|
||||||
import mozpack.path as mozpath
|
import mozpack.path as mozpath
|
||||||
import six
|
|
||||||
import toml
|
import toml
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -29,11 +28,11 @@ def _run_process(args):
|
||||||
env["CARGO"] = str(buildconfig.substs["CARGO"])
|
env["CARGO"] = str(buildconfig.substs["CARGO"])
|
||||||
env["RUSTC"] = str(buildconfig.substs["RUSTC"])
|
env["RUSTC"] = str(buildconfig.substs["RUSTC"])
|
||||||
|
|
||||||
p = subprocess.Popen(args, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.Popen(
|
||||||
|
args, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8"
|
||||||
|
)
|
||||||
|
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
stdout = six.ensure_text(stdout)
|
|
||||||
stderr = six.ensure_text(stderr)
|
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
print(stdout)
|
print(stdout)
|
||||||
print(stderr)
|
print(stderr)
|
||||||
|
|
@ -63,7 +62,8 @@ def generate_metadata(output, cargo_config):
|
||||||
if returncode != 0:
|
if returncode != 0:
|
||||||
return returncode
|
return returncode
|
||||||
|
|
||||||
output.write(stdout)
|
if stdout:
|
||||||
|
output.write(stdout)
|
||||||
|
|
||||||
# This is not quite accurate, but cbindgen only cares about a subset of the
|
# This is not quite accurate, but cbindgen only cares about a subset of the
|
||||||
# data which, when changed, causes these files to change.
|
# data which, when changed, causes these files to change.
|
||||||
|
|
@ -88,7 +88,8 @@ def generate(output, metadata_path, cbindgen_crate_path, *in_tree_dependencies):
|
||||||
if returncode != 0:
|
if returncode != 0:
|
||||||
return returncode
|
return returncode
|
||||||
|
|
||||||
output.write(stdout)
|
if stdout:
|
||||||
|
output.write(stdout)
|
||||||
|
|
||||||
deps = set()
|
deps = set()
|
||||||
deps.add(CARGO_LOCK)
|
deps.add(CARGO_LOCK)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue