chore: remove py2 compatibility code (#40375)

This commit is contained in:
David Sanders 2023-11-01 07:20:32 -07:00 committed by GitHub
parent bc1ba1fe9d
commit 425efb5e47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 15 additions and 54 deletions

View file

@ -1,4 +1,4 @@
from __future__ import print_function
#!/usr/bin/env python3
import os
import subprocess
@ -10,11 +10,6 @@ PYYAML_LIB_DIR = os.path.join(SRC_DIR, 'third_party', 'pyyaml', 'lib')
sys.path.append(PYYAML_LIB_DIR)
import yaml #pylint: disable=wrong-import-position,wrong-import-order
try:
basestring # Python 2
except NameError: # Python 3
basestring = str # pylint: disable=redefined-builtin
class Verbosity:
CHATTY = 'chatty' # stdout and stderr
@ -148,7 +143,7 @@ class TestsList():
if isinstance(value, dict):
return value
if isinstance(value, basestring):
if isinstance(value, str):
return {value: None}
raise AssertionError("unexpected shorthand type: {}".format(type(value)))