mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Drop py2 support from metrics files
python3 is the only supported version of python in depot_tools. Bug: 1475402 Change-Id: Ic925af3a79311b11a953f1d0d4602754488a9de3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4824480 Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
10
metrics.py
10
metrics.py
@@ -13,11 +13,7 @@ import sys
|
||||
import threading
|
||||
import time
|
||||
import traceback
|
||||
|
||||
try:
|
||||
import urllib2 as urllib
|
||||
except ImportError: # For Py3 compatibility
|
||||
import urllib.request as urllib
|
||||
import urllib.request
|
||||
|
||||
import detect_host_arch
|
||||
import gclient_utils
|
||||
@@ -87,9 +83,9 @@ class _Config(object):
|
||||
# check if we can reach the page. An external developer would get access
|
||||
# denied.
|
||||
try:
|
||||
req = urllib.urlopen(metrics_utils.APP_URL + '/should-upload')
|
||||
req = urllib.request.urlopen(metrics_utils.APP_URL + '/should-upload')
|
||||
self._config['is-googler'] = req.getcode() == 200
|
||||
except (urllib.URLError, urllib.HTTPError):
|
||||
except (urllib.request.URLError, urllib.request.HTTPError):
|
||||
self._config['is-googler'] = False
|
||||
|
||||
# Make sure the config variables we need are present, and initialize them to
|
||||
|
||||
Reference in New Issue
Block a user