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: |