Commit e13e12a8 authored by maruel@chromium.org's avatar maruel@chromium.org

Reorder gcl.py imports and remove gclient_utils.Popen() usage

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7840038

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100172 0039d316-1c4b-4281-b951-d872f2087c98
parent 13c271b7
......@@ -13,13 +13,13 @@ import os
import random
import re
import string
import subprocess
import sys
import tempfile
import time
from third_party import upload
import urllib2
import breakpad # pylint: disable=W0611
try:
import simplejson as json # pylint: disable=F0401
except ImportError:
......@@ -30,16 +30,13 @@ except ImportError:
sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party'))
import simplejson as json # pylint: disable=F0401
import breakpad # pylint: disable=W0611
# gcl now depends on gclient.
from scm import SVN
import fix_encoding
import gclient_utils
import presubmit_support
import rietveld
from scm import SVN
import subprocess2
from third_party import upload
__version__ = '1.2.1'
......@@ -232,8 +229,9 @@ def ErrorExit(msg):
def RunShellWithReturnCode(command, print_output=False):
"""Executes a command and returns the output and the return code."""
p = gclient_utils.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, universal_newlines=True)
p = subprocess2.Popen(
command, stdout=subprocess2.PIPE,
stderr=subprocess2.STDOUT, universal_newlines=True)
if print_output:
output_array = []
while True:
......@@ -1122,8 +1120,8 @@ def CMDchange(args):
try:
# shell=True to allow the shell to handle all forms of quotes in
# $EDITOR.
subprocess.check_call(cmd, shell=True)
except subprocess.CalledProcessError, e:
subprocess2.check_call(cmd, shell=True)
except subprocess2.CalledProcessError, e:
ErrorExit('Editor returned %d' % e.returncode)
result = gclient_utils.FileRead(filename, 'r')
finally:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment