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

Unified Diff: presubmit_support.py

Issue 181063021: Fix presubmit checks when --trybot-json flag is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: restore main-path in finally Created 6 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_support.py
diff --git a/presubmit_support.py b/presubmit_support.py
index 513b29f7cb9b532fda4082e616c7d5fc04c3d1b5..28dcf8c0a7b9c22113e97724b16828ca36598f2c 100755
--- a/presubmit_support.py
+++ b/presubmit_support.py
@@ -1020,10 +1020,14 @@ class GetTrySlavesExecuter(object):
A list of try slaves.
"""
context = {}
+ main_path = os.getcwd()
try:
+ os.chdir(os.path.dirname(presubmit_path))
exec script_text in context
except Exception, e:
raise PresubmitFailure('"%s" had an exception.\n%s' % (presubmit_path, e))
+ finally:
+ os.chdir(main_path)
function_name = 'GetPreferredTrySlaves'
if function_name in context:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698