(script_name, *args)
| 182 | |
| 183 | |
| 184 | def invoke_script(script_name, *args): |
| 185 | subprocess_env = get_modified_env_with_pythonpath() |
| 186 | |
| 187 | dir_path = os.path.dirname(os.path.realpath(__file__)) |
| 188 | python_file = os.path.join(dir_path, script_name) |
| 189 | |
| 190 | cmd = [sys.executable, python_file] |
| 191 | cmd.extend(args) |
| 192 | |
| 193 | subprocess.check_call(cmd, env=subprocess_env) |
| 194 | |
| 195 | |
| 196 | @contextlib.contextmanager |