Remove GPU six usage
Removes all remaining uses of the six module from //content/test/gpu since everything should be on Python 3 by this point. Change-Id: I0eade820431d8994c999704287da30820aa0af98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5527428 Auto-Submit: Brian Sheedy <bsheedy@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Brian Sheedy <bsheedy@chromium.org> Cr-Commit-Position: refs/heads/main@{#1299436}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
d5822229b2
commit
f634343de1
content/test/gpu
@ -15,24 +15,11 @@ import json
|
||||
import logging
|
||||
import re
|
||||
import sys
|
||||
import urllib.request as ulib_request
|
||||
import urllib.parse as ulib_parse
|
||||
import urllib.error
|
||||
|
||||
import six # pylint: disable=import-error
|
||||
|
||||
# //content/test/gpu is Python 3-only at this point, but
|
||||
# //testing/scripts/test_buildbucket_api_gpu_use_cases.py does import this file
|
||||
# via Python 2 on bots during the "get compile targets for scripts" step. So,
|
||||
# keep this compatibility in for now.
|
||||
# pylint: disable=wrong-import-position
|
||||
if six.PY3:
|
||||
import urllib.request as ulib_request
|
||||
import urllib.parse as ulib_parse
|
||||
import urllib.error
|
||||
HTTPError = urllib.error.HTTPError
|
||||
else:
|
||||
import urllib2 as ulib_request # pylint: disable=import-error
|
||||
import urllib as ulib_parse # pylint: disable=ungrouped-imports
|
||||
HTTPError = ulib_request.HTTPError
|
||||
# pylint: enable=wrong-import-position
|
||||
HTTPError = urllib.error.HTTPError
|
||||
|
||||
_TESTS = [
|
||||
'Basic', 'Video_720_MP4', 'Video_720_MP4_Fullscreen',
|
||||
|
@ -14,19 +14,7 @@ import argparse
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
|
||||
import six # pylint: disable=import-error
|
||||
|
||||
# //content/test/gpu is Python 3-only at this point, but
|
||||
# //testing/scripts/test_buildbucket_api_gpu_use_cases.py does import this file
|
||||
# via Python 2 on bots during the "get compile targets for scripts" step. So,
|
||||
# keep this compatibility in for now.
|
||||
# pylint: disable=wrong-import-position
|
||||
if six.PY3:
|
||||
import urllib.request as ulib
|
||||
else:
|
||||
import urllib2 as ulib # pylint: disable=import-error
|
||||
# pylint: enable=wrong-import-position
|
||||
import urllib.request as ulib
|
||||
|
||||
|
||||
def GetBuildData(method, request):
|
||||
|
@ -7,8 +7,6 @@ import sys
|
||||
from typing import Any, List, Optional, Union
|
||||
import unittest
|
||||
|
||||
import six
|
||||
|
||||
import dataclasses # Built-in, but pylint gives an ordering false positive.
|
||||
|
||||
from gpu_tests import common_typing as ct
|
||||
@ -217,7 +215,7 @@ class InfoCollectionTest(gpu_integration_test.GpuIntegrationTest):
|
||||
|
||||
@staticmethod
|
||||
def _ValueToStr(value: Union[str, bool]) -> str:
|
||||
if isinstance(value, six.string_types):
|
||||
if isinstance(value, str):
|
||||
return value
|
||||
if isinstance(value, bool):
|
||||
return 'supported' if value else 'unsupported'
|
||||
|
Reference in New Issue
Block a user