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

Side by Side Diff: subprocess2.py

Issue 6690034: Add more python 2.5 compatibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Don't force python 2.5 anymore (to be done in a separate change) Created 9 years, 8 months 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 | tests/fake_repos.py » ('j') | tests/owners_unittest.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding=utf8 1 # coding=utf8
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Collection of subprocess wrapper functions. 5 """Collection of subprocess wrapper functions.
6 6
7 In theory you shouldn't need anything else in subprocess, or this module failed. 7 In theory you shouldn't need anything else in subprocess, or this module failed.
8 """ 8 """
9 9
10 from __future__ import with_statement
10 import logging 11 import logging
11 import os 12 import os
12 import subprocess 13 import subprocess
13 import sys 14 import sys
14 import tempfile 15 import tempfile
15 import time 16 import time
16 import threading 17 import threading
17 18
18 # Constants forwarded from subprocess. 19 # Constants forwarded from subprocess.
19 PIPE = subprocess.PIPE 20 PIPE = subprocess.PIPE
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 194
194 Discards communicate()[1]. By default sets stderr=STDOUT. 195 Discards communicate()[1]. By default sets stderr=STDOUT.
195 196
196 Throws if return code is not 0. 197 Throws if return code is not 0.
197 198
198 Works even prior to python 2.7. 199 Works even prior to python 2.7.
199 """ 200 """
200 if kwargs.get('stderr') is None: 201 if kwargs.get('stderr') is None:
201 kwargs['stderr'] = STDOUT 202 kwargs['stderr'] = STDOUT
202 return check_call(args, stdout=PIPE, **kwargs)[0] 203 return check_call(args, stdout=PIPE, **kwargs)[0]
OLDNEW
« no previous file with comments | « no previous file | tests/fake_repos.py » ('j') | tests/owners_unittest.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698