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:
Gavin Mak
2023-08-30 15:39:13 +00:00
committed by LUCI CQ
parent 1c1cc06a0d
commit 5f955dfff1
3 changed files with 12 additions and 24 deletions

View File

@@ -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