diff --git a/presubmit_support.py b/presubmit_support.py index 1f4265fb9..d677dcd77 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -1611,8 +1611,7 @@ def DoPostUploadExecuter(change, gerrit_obj, verbose): gerrit_obj: The GerritAccessor object. verbose: Prints debug info. """ - python_version = 'Python %s' % sys.version_info.major - sys.stdout.write('Running %s post upload checks ...\n' % python_version) + sys.stdout.write('Running post upload checks ...\n') presubmit_files = ListRelevantPresubmitFiles( change.LocalPaths() + change.LocalSubmodules(), change.RepositoryRoot()) if not presubmit_files and verbose: @@ -1923,13 +1922,10 @@ def DoPresubmitChecks(change, 1 if presubmit checks failed or 0 otherwise. """ with setup_environ({'PYTHONDONTWRITEBYTECODE': '1'}): - python_version = 'Python %s' % sys.version_info.major if committing: - sys.stdout.write('Running %s presubmit commit checks ...\n' % - python_version) + sys.stdout.write('Running presubmit commit checks ...\n') else: - sys.stdout.write('Running %s presubmit upload checks ...\n' % - python_version) + sys.stdout.write('Running presubmit upload checks ...\n') start_time = time_time() presubmit_files = ListRelevantPresubmitFiles( change.AbsoluteLocalPaths() + change.AbsoluteLocalSubmodules(), @@ -1987,18 +1983,16 @@ def DoPresubmitChecks(change, total_time) if not should_prompt and not presubmits_failed: - sys.stdout.write('%s presubmit checks passed.\n\n' % python_version) + sys.stdout.write('presubmit checks passed.\n\n') elif should_prompt and not presubmits_failed: - sys.stdout.write('There were %s presubmit warnings. ' % - python_version) + sys.stdout.write('There were presubmit warnings. ') if may_prompt: presubmits_failed = not prompt_should_continue( 'Are you sure you wish to continue? (y/N): ') else: sys.stdout.write('\n') else: - sys.stdout.write('There were %s presubmit errors.\n' % - python_version) + sys.stdout.write('There were presubmit errors.\n') if json_output: # Write the presubmit results to json output diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 25867cb02..0edb42c9f 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -43,7 +43,7 @@ import subprocess2 as subprocess # Shortcut. presubmit_canned_checks = presubmit.presubmit_canned_checks -RUNNING_PY_CHECKS_TEXT = ('Running Python 3 presubmit upload checks ...\n') +RUNNING_PY_CHECKS_TEXT = ('Running presubmit upload checks ...\n') # Access to a protected member XXX of a client class # pylint: disable=protected-access @@ -621,7 +621,7 @@ class PresubmitUnittest(PresubmitTestsBase): presubmit.DoPostUploadExecuter(change=change, gerrit_obj=None, verbose=False)) - expected = (r'Running Python 3 post upload checks \.\.\.\n') + expected = (r'Running post upload checks \.\.\.\n') self.assertRegexpMatches(sys.stdout.getvalue(), expected) def testDoPostUploadExecuterWarning(self): @@ -636,7 +636,7 @@ class PresubmitUnittest(PresubmitTestsBase): gerrit_obj=None, verbose=False)) self.assertEqual( - 'Running Python 3 post upload checks ...\n' + 'Running post upload checks ...\n' '\n' '** Post Upload Hook Messages **\n' '??\n' @@ -654,7 +654,7 @@ class PresubmitUnittest(PresubmitTestsBase): gerrit_obj=None, verbose=False)) - expected = ('Running Python 3 post upload checks \.\.\.\n' + expected = ('Running post upload checks \.\.\.\n' '\n' '\*\* Post Upload Hook Messages \*\*\n' '!!\n' @@ -894,7 +894,7 @@ def CheckChangeOnCommit(input_api, output_api): RUNNING_PY_CHECKS_TEXT + 'Warning, no PRESUBMIT.py found.\n' 'Running default presubmit script.\n' '** Presubmit ERRORS: 1 **\n!!\n\n' - 'There were Python 3 presubmit errors.\n' + 'There were presubmit errors.\n' 'Was the presubmit check useful? If not, run "git cl presubmit -v"\n' 'to figure out which PRESUBMIT.py was run, then run "git blame"\n' 'on the file to figure out who to ask for help.\n')