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 ...@@ -13,13 +13,13 @@ import os
import random import random
import re import re
import string import string
import subprocess
import sys import sys
import tempfile import tempfile
import time import time
from third_party import upload
import urllib2 import urllib2
import breakpad # pylint: disable=W0611
try: try:
import simplejson as json # pylint: disable=F0401 import simplejson as json # pylint: disable=F0401
except ImportError: except ImportError:
...@@ -30,16 +30,13 @@ except ImportError: ...@@ -30,16 +30,13 @@ except ImportError:
sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party'))
import simplejson as json # pylint: disable=F0401 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 fix_encoding
import gclient_utils import gclient_utils
import presubmit_support import presubmit_support
import rietveld import rietveld
from scm import SVN
import subprocess2 import subprocess2
from third_party import upload
__version__ = '1.2.1' __version__ = '1.2.1'
...@@ -232,8 +229,9 @@ def ErrorExit(msg): ...@@ -232,8 +229,9 @@ def ErrorExit(msg):
def RunShellWithReturnCode(command, print_output=False): def RunShellWithReturnCode(command, print_output=False):
"""Executes a command and returns the output and the return code.""" """Executes a command and returns the output and the return code."""
p = gclient_utils.Popen(command, stdout=subprocess.PIPE, p = subprocess2.Popen(
stderr=subprocess.STDOUT, universal_newlines=True) command, stdout=subprocess2.PIPE,
stderr=subprocess2.STDOUT, universal_newlines=True)
if print_output: if print_output:
output_array = [] output_array = []
while True: while True:
...@@ -1122,8 +1120,8 @@ def CMDchange(args): ...@@ -1122,8 +1120,8 @@ def CMDchange(args):
try: try:
# shell=True to allow the shell to handle all forms of quotes in # shell=True to allow the shell to handle all forms of quotes in
# $EDITOR. # $EDITOR.
subprocess.check_call(cmd, shell=True) subprocess2.check_call(cmd, shell=True)
except subprocess.CalledProcessError, e: except subprocess2.CalledProcessError, e:
ErrorExit('Editor returned %d' % e.returncode) ErrorExit('Editor returned %d' % e.returncode)
result = gclient_utils.FileRead(filename, 'r') result = gclient_utils.FileRead(filename, 'r')
finally: 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