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

Issue 6792054: Convert PRESUBMIT.py to use check_output() instead of Popen(). (Closed)

Created:
9 years, 8 months ago by M-A Ruel
Modified:
9 years, 7 months ago
Reviewers:
Dirk Pranke
CC:
chromium-reviews, Dirk Pranke, M-A Ruel
Visibility:
Public.

Description

Convert PRESUBMIT.py to use check_output() instead of Popen(). Fix execution on windows. Remove more code. R=dpranke@chromium.org BUG= TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=80617

Patch Set 1 #

Patch Set 2 : Fix on windows too #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -25 lines) Patch
M PRESUBMIT.py View 1 4 chunks +17 lines, -25 lines 1 comment Download

Messages

Total messages: 3 (0 generated)
M-A Ruel
9 years, 8 months ago (2011-04-05 18:52:49 UTC) #1
Dirk Pranke
LGTM (but see note below for something I think we need to change at some ...
9 years, 8 months ago (2011-04-05 21:11:42 UTC) #2
M-A Ruel
9 years, 8 months ago (2011-04-06 01:38:13 UTC) #3
Le 5 avril 2011 17:11, <dpranke@chromium.org> a écrit :

> LGTM (but see note below for something I think we need to change at some
> point
> soon).
>
>
> http://codereview.chromium.org/6792054/diff/3/PRESUBMIT.py
> File PRESUBMIT.py (right):
>
> http://codereview.chromium.org/6792054/diff/3/PRESUBMIT.py#newcode87
> PRESUBMIT.py:87: results.append(output_api.PresubmitError('%s
>
> failed\n%s' % (test, e)))
> Maybe something to change separate from this patch, but I find this to
> be much less clear than what we had before. It's not at all obvious from
> the block that the important differences is that check_call uses
> stdout=None and check_output doesn't. Can we compromise by using
> check_call and passing in the right values for stdout/stderr, or maybe
> make the names more explicit or something (this is also related to the
> comment on your win32 patch).


It's related to what subprocess does. Only call() and check_call() are
important, the remainders are utility wrappers.

I used check_capture() instead of check_output() before but they decided to
use check_output() in python 2.7. Go figure why they chose this name.

M-A

http://codereview.chromium.org/6792054/
>

Powered by Google App Engine
This is Rietveld 408576698