mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
depot_tools: Make some changes to make metrics collection compatible with Python 3.
Bug: 984182 Change-Id: I55e9e83d01d5a86464cc234c083e4212f0ba4a1e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1713217 Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org> Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
This commit is contained in:
@@ -4,18 +4,19 @@
|
||||
# found in the LICENSE file.
|
||||
|
||||
import sys
|
||||
import urllib2
|
||||
|
||||
from third_party.six.moves import urllib
|
||||
from third_party.six.moves import input # pylint: disable=redefined-builtin
|
||||
|
||||
import metrics_utils
|
||||
|
||||
|
||||
def main():
|
||||
metrics = raw_input()
|
||||
metrics = input()
|
||||
try:
|
||||
urllib2.urlopen(metrics_utils.APP_URL + '/upload', metrics)
|
||||
except urllib2.HTTPError:
|
||||
pass
|
||||
except urllib2.URLError:
|
||||
urllib.request.urlopen(
|
||||
metrics_utils.APP_URL + '/upload', metrics.encode('utf-8'))
|
||||
except (urllib.error.HTTPError, urllib.error.URLError):
|
||||
pass
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user