gittip: Use Meson's capture: true for Python 3.6 compatibility (#2869)

This commit is contained in:
Khairul Azhar Kasmiran 2022-08-04 22:37:58 +08:00 committed by GitHub
parent 48bed79824
commit 2588aa8a1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -4067,6 +4067,7 @@ RZ_API char *rz_str_version(const char *program) {
if (!gittip || !*rz_str_trim_head_ro(gittip)) {
goto done;
}
rz_str_trim(gittip);
rz_strbuf_append(sb, "\n");
rz_strbuf_appendf(sb, "commit: %s", gittip);
done:

View file

@ -540,6 +540,7 @@ if git_exe.found() and fs.exists('.git')
build_by_default: true,
output: 'gittip',
command: [py3_exe, git_exe_repo_py, git_exe, repo, 'rev-parse', 'HEAD'],
capture: true,
install: true,
install_dir: rizin_bindir
)

View file

@ -25,9 +25,7 @@ def isCArgSupported(executable, path):
def simple_git_execution(args):
try:
called = subprocess.run(args, check=True, capture_output=True)
with open("gittip", "w", encoding="utf8") as f:
f.write(called.stdout.decode("utf8").strip())
called = subprocess.run(args, check=True)
sys.exit(called.returncode)
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)