python: drop python2 support

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>
This commit is contained in:
Eric Engestrom
2020-02-02 18:25:47 +00:00
committed by Marge Bot
parent dac09a3119
commit f1eae2f8bb
63 changed files with 10 additions and 144 deletions

View File

@@ -21,7 +21,6 @@
"""Run glcpp tests with various line endings."""
from __future__ import print_function
import argparse
import difflib
import errno

View File

@@ -19,7 +19,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from __future__ import print_function
import sys
import subprocess
import tempfile

View File

@@ -21,7 +21,6 @@
"""Script to generate and run glsl optimization tests."""
from __future__ import print_function
import argparse
import difflib
import errno

View File

@@ -29,10 +29,6 @@
import re
import sys
if sys.version_info >= (3, 0, 0):
STRING_TYPE = str
else:
STRING_TYPE = unicode
def check_sexp(sexp):
"""Verify that the argument is a proper sexp.
@@ -44,7 +40,7 @@ def check_sexp(sexp):
if isinstance(sexp, list):
for s in sexp:
check_sexp(s)
elif not isinstance(sexp, (STRING_TYPE, bytes)):
elif not isinstance(sexp, (str, bytes)):
raise Exception('Not a sexp: {0!r}'.format(sexp))
def parse_sexp(sexp):
@@ -75,7 +71,7 @@ def sexp_to_string(sexp):
"""Convert a sexp, represented as nested lists containing strings,
into a single string of the form parseable by mesa.
"""
if isinstance(sexp, STRING_TYPE):
if isinstance(sexp, str):
return sexp
if isinstance(sexp, bytes):
return sexp.encode('utf-8')

View File

@@ -19,7 +19,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from __future__ import print_function
import argparse
import errno
import os