Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: Use execve and set envvars instead of execv" #1160

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bench/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
9 changes: 3 additions & 6 deletions bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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():
Expand Down