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
+2 -11
View File
@@ -35,20 +35,11 @@
*/
'''
from __future__ import division, print_function
import sys
from u_format_parse import *
if sys.version_info < (3, 0):
integer_types = (int, long)
else:
integer_types = (int, )
def inv_swizzles(swizzles):
'''Return an array[4] of inverse swizzle terms'''
'''Only pick the first matching value to avoid l8 getting blue and i8 getting alpha'''
@@ -220,7 +211,7 @@ def truncate_mantissa(x, bits):
'''Truncate an integer so it can be represented exactly with a floating
point mantissa'''
assert isinstance(x, integer_types)
assert isinstance(x, int)
s = 1
if x < 0:
@@ -244,7 +235,7 @@ def value_to_native(type, value):
'''Get the value of unity for this type.'''
if type.type == FLOAT:
if type.size <= 32 \
and isinstance(value, integer_types):
and isinstance(value, int):
return truncate_mantissa(value, 23)
return value
if type.type == FIXED: