Skip to content

Commit

Permalink
Replace call to execfile(...) by call to exec(compile(open(...)))
Browse files Browse the repository at this point in the history
This is done in order to be compatible with Python3
  • Loading branch information
marmeladema committed Oct 20, 2019
1 parent 882dcc8 commit 865d737
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/mach_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _activate_virtualenv(topdir, is_firefox):
# We want to upgrade pip when virtualenv created for the first time
need_pip_upgrade = True

execfile(activate_path, dict(__file__=activate_path))
exec(compile(open(activate_path).read(), activate_path, 'exec'), dict(__file__=activate_path))

python = _get_exec_path(PYTHON_NAMES, is_valid_path=check_exec_path)
if not python:
Expand Down
10 changes: 5 additions & 5 deletions python/servo/testing_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def test_webidl(self, quiet, tests):

run_file = path.abspath(path.join(test_file_dir, "runtests.py"))
run_globals = {"__file__": run_file}
execfile(run_file, run_globals)
exec(compile(open(run_file).read(), run_file, 'exec'), run_globals)

verbose = not quiet
return run_globals["run_tests"](tests, verbose)
Expand Down Expand Up @@ -442,7 +442,7 @@ def wptrunner(self, run_file, **kwargs):
kwargs["binary_args"] = binary_args

run_globals = {"__file__": run_file}
execfile(run_file, run_globals)
exec(compile(open(run_file).read(), run_file, 'exec'), run_globals)
return run_globals["run_tests"](**kwargs)

@Command('update-manifest',
Expand Down Expand Up @@ -473,7 +473,7 @@ def update_wpt(self, **kwargs):
return 1

run_globals = {"__file__": run_file}
execfile(run_file, run_globals)
exec(compile(open(run_file).read(), run_file, 'exec'), run_globals)
return run_globals["update_tests"](**kwargs)

@Command('filter-intermittents',
Expand Down Expand Up @@ -913,7 +913,7 @@ def update_net_cookies(self):
"components", "net", "tests",
"cookie_http_state_utils.py"))
run_globals = {"__file__": run_file}
execfile(run_file, run_globals)
exec(compile(open(run_file).read(), run_file, 'exec'), run_globals)
return run_globals["update_test_file"](cache_dir)

@Command('update-webgl',
Expand All @@ -934,7 +934,7 @@ def update_webgl(self, version=None):
shutil.rmtree(dest_folder)

run_globals = {"__file__": run_file}
execfile(run_file, run_globals)
exec(compile(open(run_file).read(), run_file, 'exec'), run_globals)
return run_globals["update_conformance"](version, dest_folder, None, patches_dir)

@Command('smoketest',
Expand Down

0 comments on commit 865d737

Please sign in to comment.