summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2021-10-22 18:49:54 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2021-10-22 18:49:54 +0100
commita42b5d680935f08310de69f240435a7b67227a4d (patch)
tree22a95db2b4265dcb4e0fa91b8f575ffea5fe7a66
parente5cd9cb90f74c46ad59ba697bb70e7a425bf631d (diff)
SL-15999 - made cwd handling a bit more robust in perfbot_run.py
-rw-r--r--scripts/perf/perfbot_run.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/perf/perfbot_run.py b/scripts/perf/perfbot_run.py
index 006d5f8934..55ea2fae66 100644
--- a/scripts/perf/perfbot_run.py
+++ b/scripts/perf/perfbot_run.py
@@ -75,12 +75,12 @@ def gen_niv_script(args):
# you can also specify it explicitly with the --cwd parameter
# (required for dev builds)
args.viewer = os.path.abspath(args.viewer)
- working_dir = args.cwd
if len(args.cwd) == 0:
working_dir = os.path.dirname(os.path.abspath(args.viewer))
- print(f"Working directory is {working_dir} {args.cwd=}")
- environ = os.environ
- environ["cwd"] = working_dir
+ else:
+ working_dir = os.path.abspath(args.cwd)
+ print(f"Working directory is {working_dir}, cwd {args.cwd}")
+ os.chdir(working_dir)
if args.dryrun:
print("Running in dry-run mode - no Viewers will be started")
@@ -138,7 +138,7 @@ def gen_niv_script(args):
# usefully, display the script lines) but do not start the Viewer
if args.dryrun == False:
print("opening viewer session with",script_cmd)
- viewer_session = subprocess.Popen(script_cmd,env=environ)
+ viewer_session = subprocess.Popen(script_cmd)
# Sleeping a bit between launches seems to help avoid a CPU
# surge when N Viewers are started simulatanously. The default