mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Improve gclient Python 3 compatibility
This enables gclient sync and gclient runhooks to run, barring hook script failures. git cl upload also now works. The scripts still work with Python 2. There are no intended behaviour changes. Bug: 942522 Change-Id: I2ac587b5f803ba7f5bb5e412337ce049f4b1a741 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524583 Commit-Queue: Raul Tambre <raul@tambre.ee> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This commit is contained in:
@@ -9,7 +9,11 @@ import re
|
||||
import scm
|
||||
import subprocess2
|
||||
import sys
|
||||
import urlparse
|
||||
|
||||
try:
|
||||
import urlparse
|
||||
except ImportError: # For Py3 compatibility
|
||||
import urllib.parse as urlparse
|
||||
|
||||
|
||||
# Current version of metrics recording.
|
||||
@@ -280,7 +284,7 @@ def print_boxed_text(out, min_width, lines):
|
||||
width = max(min_width, max(len(line) for line in lines))
|
||||
out(SE + EW * (width + 2) + SW + '\n')
|
||||
for line in lines:
|
||||
out('%s %-*s %s\n' % (NS, width, line, NS))
|
||||
out('%s %-*s %s\n' % (NS, width, line, NS))
|
||||
out(NE + EW * (width + 2) + NW + '\n')
|
||||
|
||||
def print_notice(countdown):
|
||||
|
||||
Reference in New Issue
Block a user