summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Engestrom <eric.engestrom@intel.com>2019-11-15 00:46:57 +0000
committerEric Engestrom <eric.engestrom@intel.com>2019-11-19 14:08:19 +0000
commitad2aac0c9874f78a37218db19719ec83f4154d7e (patch)
tree0082e49109c741aaa2caa893b8d58123cc977508
parentd3d8a92a138e442790883158bc3f847c36b7077e (diff)
python: fix collections.abc warning
> DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
-rw-r--r--generated_tests/gen_shader_precision_tests.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/generated_tests/gen_shader_precision_tests.py b/generated_tests/gen_shader_precision_tests.py
index 6ab83e0ad..11683a153 100644
--- a/generated_tests/gen_shader_precision_tests.py
+++ b/generated_tests/gen_shader_precision_tests.py
@@ -85,7 +85,13 @@ shader_precision_spec_fns = ('op-add', 'op-assign-add',
'sqrt', 'inversesqrt')
def _is_sequence(arg):
- return isinstance(arg, (collections.Sequence, numpy.ndarray))
+ try:
+ # python 3.3+
+ Sequence = collections.abc.Sequence
+ except AttributeError:
+ # python 2.7+, removed in 3.9
+ Sequence = collections.Sequence
+ return isinstance(arg, (Sequence, numpy.ndarray))
def _floatToBits(f):
s = struct.pack('>f', f)