From 64fbeee1e6a9dbe65ce17131344a1d4ca2b5bcd8 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 26 Apr 2021 11:32:20 +0530 Subject: [PATCH] Revert "fix: Use execve and set envvars instead of execv" This reverts commit 530a980ef74fd20a9de289284fde16875256b49b. --- bench/cli.py | 6 +++--- bench/utils.py | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/bench/cli.py b/bench/cli.py index 3b5d16b9..05c74d86 100755 --- a/bench/cli.py +++ b/bench/cli.py @@ -109,19 +109,19 @@ def change_uid(): def old_frappe_cli(bench_path='.'): f = get_frappe(bench_path=bench_path) os.chdir(os.path.join(bench_path, 'sites')) - os.execve(f, [f] + sys.argv[2:], {}) + os.execv(f, [f] + sys.argv[2:]) def app_cmd(bench_path='.'): f = get_env_cmd('python', bench_path=bench_path) os.chdir(os.path.join(bench_path, 'sites')) - os.execve(f, [f] + ['-m', 'frappe.utils.bench_helper'] + sys.argv[1:], {}) + os.execv(f, [f] + ['-m', 'frappe.utils.bench_helper'] + sys.argv[1:]) def frappe_cmd(bench_path='.'): f = get_env_cmd('python', bench_path=bench_path) os.chdir(os.path.join(bench_path, 'sites')) - os.execve(f, [f] + ['-m', 'frappe.utils.bench_helper', 'frappe'] + sys.argv[1:], {}) + os.execv(f, [f] + ['-m', 'frappe.utils.bench_helper', 'frappe'] + sys.argv[1:]) def get_frappe_commands(): diff --git a/bench/utils.py b/bench/utils.py index 49529c10..7bb312ba 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -453,15 +453,12 @@ def get_process_manager(): def start(no_dev=False, concurrency=None, procfile=None, no_prefix=False): - env = os.environ program = get_process_manager() - if not program: raise Exception("No process manager found") - - env['PYTHONUNBUFFERED'] = "true" + os.environ['PYTHONUNBUFFERED'] = "true" if not no_dev: - env['DEV_SERVER'] = "true" + os.environ['DEV_SERVER'] = "true" command = [program, 'start'] if concurrency: @@ -473,7 +470,7 @@ def start(no_dev=False, concurrency=None, procfile=None, no_prefix=False): if no_prefix: command.extend(['--no-prefix']) - os.execve(program, command, env=env) + os.execv(program, command) def get_git_version():