Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1641)

Unified Diff: run_isolated.py

Issue 25549003: Fix running 'import run_isolated' at python interactive prompt. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/tools/swarm_client@1_update_item
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | swarming.py » ('j') | utils/zip_package.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: run_isolated.py
diff --git a/run_isolated.py b/run_isolated.py
index 0c1b4cc0c7552350a98b9caca9000d071198b25e..9e0ad754e7a0715a6ab9cd3e6bb8932ecce65107 100755
--- a/run_isolated.py
+++ b/run_isolated.py
@@ -39,7 +39,9 @@ THIS_FILE_PATH = os.path.abspath(__file__) if __file__ else None
BASE_DIR = os.path.dirname(THIS_FILE_PATH) if __file__ else None
# Directory that contains currently running script file.
-MAIN_DIR = os.path.dirname(os.path.abspath(zip_package.get_main_script_path()))
+MAIN_DIR = (
Vadim Sh. 2013/10/01 18:59:51 nit: I'd change it into regular 'if' and added com
M-A Ruel 2013/10/01 19:06:35 Done.
+ os.path.dirname(os.path.abspath(zip_package.get_main_script_path()))
+ if zip_package.get_main_script_path() else None)
# Types of action accepted by link_file().
HARDLINK, HARDLINK_WITH_FALLBACK, SYMLINK, COPY = range(1, 5)
@@ -514,8 +516,9 @@ def run_tha_test(isolated_hash, cache_dir, retriever, policies):
# TODO(vadimsh): Pass it via 'env_vars' in manifest.
# Add a rotating log file if one doesn't already exist.
env = os.environ.copy()
- env.setdefault('RUN_TEST_CASES_LOG_FILE',
- os.path.join(MAIN_DIR, RUN_TEST_CASES_LOG))
+ if MAIN_DIR:
+ env.setdefault('RUN_TEST_CASES_LOG_FILE',
+ os.path.join(MAIN_DIR, RUN_TEST_CASES_LOG))
try:
with tools.Profiler('RunTest'):
return subprocess.call(settings.command, cwd=cwd, env=env)
« no previous file with comments | « no previous file | swarming.py » ('j') | utils/zip_package.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698