mirror of
https://github.com/frappe/bench.git
synced 2024-11-13 16:56:33 +00:00
Merge pull request #710 from sagarvora/patch-1
[python 3.7] async is a keyword => use is_async
This commit is contained in:
commit
f969555835
@ -139,8 +139,8 @@ def clone_apps_from(bench_path, clone_from, update_app=True):
|
|||||||
def exec_cmd(cmd, cwd='.'):
|
def exec_cmd(cmd, cwd='.'):
|
||||||
from .cli import from_command_line
|
from .cli import from_command_line
|
||||||
|
|
||||||
async = False if from_command_line else True
|
is_async = False if from_command_line else True
|
||||||
if async:
|
if is_async:
|
||||||
stderr = stdout = subprocess.PIPE
|
stderr = stdout = subprocess.PIPE
|
||||||
else:
|
else:
|
||||||
stderr = stdout = None
|
stderr = stdout = None
|
||||||
@ -150,7 +150,7 @@ def exec_cmd(cmd, cwd='.'):
|
|||||||
p = subprocess.Popen(cmd, cwd=cwd, shell=True, stdout=stdout, stderr=stderr,
|
p = subprocess.Popen(cmd, cwd=cwd, shell=True, stdout=stdout, stderr=stderr,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
|
|
||||||
if async:
|
if is_async:
|
||||||
return_code = print_output(p)
|
return_code = print_output(p)
|
||||||
else:
|
else:
|
||||||
return_code = p.wait()
|
return_code = p.wait()
|
||||||
@ -603,8 +603,8 @@ def run_frappe_cmd(*args, **kwargs):
|
|||||||
f = get_env_cmd('python', bench_path=bench_path)
|
f = get_env_cmd('python', bench_path=bench_path)
|
||||||
sites_dir = os.path.join(bench_path, 'sites')
|
sites_dir = os.path.join(bench_path, 'sites')
|
||||||
|
|
||||||
async = False if from_command_line else True
|
is_async = False if from_command_line else True
|
||||||
if async:
|
if is_async:
|
||||||
stderr = stdout = subprocess.PIPE
|
stderr = stdout = subprocess.PIPE
|
||||||
else:
|
else:
|
||||||
stderr = stdout = None
|
stderr = stdout = None
|
||||||
@ -612,7 +612,7 @@ def run_frappe_cmd(*args, **kwargs):
|
|||||||
p = subprocess.Popen((f, '-m', 'frappe.utils.bench_helper', 'frappe') + args,
|
p = subprocess.Popen((f, '-m', 'frappe.utils.bench_helper', 'frappe') + args,
|
||||||
cwd=sites_dir, stdout=stdout, stderr=stderr)
|
cwd=sites_dir, stdout=stdout, stderr=stderr)
|
||||||
|
|
||||||
if async:
|
if is_async:
|
||||||
return_code = print_output(p)
|
return_code = print_output(p)
|
||||||
else:
|
else:
|
||||||
return_code = p.wait()
|
return_code = p.wait()
|
||||||
|
Loading…
Reference in New Issue
Block a user