From f587c544a5a2097ee790dc4462b045603ded91db Mon Sep 17 00:00:00 2001 From: BennyThink Date: Sat, 12 Feb 2022 19:36:58 +0800 Subject: [PATCH] we should use `subprocess.call` because it'll return 0 or other exit code --- ytdlbot/tasks.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ytdlbot/tasks.py b/ytdlbot/tasks.py index d0b8a04..ab0d02f 100644 --- a/ytdlbot/tasks.py +++ b/ytdlbot/tasks.py @@ -337,14 +337,14 @@ def hot_patch(*args): pull_unshallow = "git pull origin --unshallow" pull = "git pull" - subprocess.check_output(unset, shell=True, cwd=app_path) - if subprocess.check_output(pull_unshallow, shell=True, cwd=app_path) != 0: + subprocess.call(unset, shell=True, cwd=app_path) + if subprocess.call(pull_unshallow, shell=True, cwd=app_path) != 0: logging.info("Already unshallow, pulling now...") - subprocess.check_output(pull, shell=True, cwd=app_path) + subprocess.call(pull, shell=True, cwd=app_path) logging.info("Code is updated, applying hot patch now...") - subprocess.check_output(apk_install, shell=True, cwd=app_path) - subprocess.check_output(pip_install, shell=True, cwd=app_path) + subprocess.call(apk_install, shell=True, cwd=app_path) + subprocess.call(pip_install, shell=True, cwd=app_path) psutil.Process().kill()