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

Unified Diff: gcl.py

Issue 7840038: Reorder gcl.py imports and remove gclient_utils.Popen() usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
diff --git a/gcl.py b/gcl.py
index e038d5d738575107d981b2147cd90e2491423ba0..c8ebc647c849108a0b493ef4b27e678e07deb51d 100755
--- a/gcl.py
+++ b/gcl.py
@@ -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:
« 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