diff --git a/gcl.py b/gcl.py index 0c8fbb61ef..dffc566330 100755 --- a/gcl.py +++ b/gcl.py @@ -532,7 +532,7 @@ class ChangeInfo(object): if fail_on_not_found: ErrorExit("Changelist " + changename + " not found.") return ChangeInfo(changename, 0, 0, '', None, local_root, None, False) - content = gclient_utils.FileRead(info_file, 'r') + content = gclient_utils.FileRead(info_file) save = False try: values = ChangeInfo._LoadNewFormat(content) @@ -1137,7 +1137,7 @@ def CMDchange(args): subprocess2.check_call(cmd, shell=True) except subprocess2.CalledProcessError, e: ErrorExit('Editor returned %d' % e.returncode) - result = gclient_utils.FileRead(filename, 'r') + result = gclient_utils.FileRead(filename) finally: os.remove(filename) diff --git a/presubmit_support.py b/presubmit_support.py index fa2261a7ff..85b3a3f70c 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -897,9 +897,9 @@ class GetTrySlavesExecuter(object): if function_name in context: get_preferred_try_slaves = context[function_name] function_info = inspect.getargspec(get_preferred_try_slaves) - if len(function_info.args) == 1: + if len(function_info[0]) == 1: result = get_preferred_try_slaves(project) - elif len(function_info.args) == 2: + elif len(function_info[0]) == 2: result = get_preferred_try_slaves(project, change) else: result = get_preferred_try_slaves() diff --git a/tests/gcl_unittest.py b/tests/gcl_unittest.py index 2cccc60dae..e013df2e24 100755 --- a/tests/gcl_unittest.py +++ b/tests/gcl_unittest.py @@ -216,7 +216,7 @@ class ChangeInfoUnittest(GclTestsBase): description = ["This is some description.", "force an extra separator."] gcl.GetChangelistInfoFile('bleh').AndReturn('bleeeh') gcl.os.path.exists('bleeeh').AndReturn(True) - gcl.gclient_utils.FileRead('bleeeh', 'r').AndReturn( + gcl.gclient_utils.FileRead('bleeeh').AndReturn( gcl.ChangeInfo._SEPARATOR.join(["42, 53", "G b.cc"] + description)) gcl.GetCodeReviewSetting('CODE_REVIEW_SERVER').AndReturn('foo') # Does an upgrade. @@ -236,7 +236,7 @@ class ChangeInfoUnittest(GclTestsBase): self.mox.StubOutWithMock(gcl, 'GetCodeReviewSetting') gcl.GetChangelistInfoFile('bleh').AndReturn('bleeeh') gcl.os.path.exists('bleeeh').AndReturn(True) - gcl.gclient_utils.FileRead('bleeeh', 'r').AndReturn( + gcl.gclient_utils.FileRead('bleeeh').AndReturn( gcl.ChangeInfo._SEPARATOR.join(["", "", ""])) gcl.GetCodeReviewSetting('CODE_REVIEW_SERVER').AndReturn('foo') # Does an upgrade.