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

Side by Side Diff: cros_mark_as_stable.py

Issue 5063004: Don't use output argument for CalledProcessError (Python 2.7 only) (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """This module uprevs a given package's ebuild to the next revision.""" 7 """This module uprevs a given package's ebuild to the next revision."""
8 8
9 9
10 import fileinput 10 import fileinput
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 _SimpleRunCommand('git push') 241 _SimpleRunCommand('git push')
242 242
243 243
244 def _SimpleRunCommand(command): 244 def _SimpleRunCommand(command):
245 """Runs a shell command and returns stdout back to caller.""" 245 """Runs a shell command and returns stdout back to caller."""
246 _Print(' + %s' % command) 246 _Print(' + %s' % command)
247 proc_handle = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) 247 proc_handle = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
248 stdout = proc_handle.communicate()[0] 248 stdout = proc_handle.communicate()[0]
249 retcode = proc_handle.wait() 249 retcode = proc_handle.wait()
250 if retcode != 0: 250 if retcode != 0:
251 raise subprocess.CalledProcessError(retcode, command, output=stdout) 251 _Print(stdout)
252 raise subprocess.CalledProcessError(retcode, command)
252 return stdout 253 return stdout
253 254
254 255
255 # ======================= End Global Helper Functions ======================== 256 # ======================= End Global Helper Functions ========================
256 257
257 258
258 class _GitBranch(object): 259 class _GitBranch(object):
259 """Wrapper class for a git branch.""" 260 """Wrapper class for a git branch."""
260 261
261 def __init__(self, branch_name): 262 def __init__(self, branch_name):
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 raise 549 raise
549 550
550 if revved_packages: 551 if revved_packages:
551 _CleanStalePackages(gflags.FLAGS.board, revved_packages) 552 _CleanStalePackages(gflags.FLAGS.board, revved_packages)
552 else: 553 else:
553 work_branch.Delete() 554 work_branch.Delete()
554 555
555 556
556 if __name__ == '__main__': 557 if __name__ == '__main__':
557 main(sys.argv) 558 main(sys.argv)
OLDNEW
« 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