Description: Add Python 3.10 support
Author: Dominik Kutra
Bug-Debian: https://bugs.debian.org/984049
Origin: upstream, https://github.com/ukoethe/vigra/pull/501/files#diff-aebec2bf372cb2b63b5d8b26f9c5e12326ab46ce4f422cafad97aca761bc2c4d

Index: libvigraimpex/vigranumpy/lib/arraytypes.py
===================================================================
--- libvigraimpex.orig/vigranumpy/lib/arraytypes.py
+++ libvigraimpex/vigranumpy/lib/arraytypes.py
@@ -39,11 +39,17 @@ import sys
 import copy
 import numpy
 import vigra.ufunc as ufunc
-import collections
 import vigra.vigranumpycore as vigranumpycore
 
 from vigra.vigranumpycore import AxisType, AxisInfo, AxisTags
 
+try:
+    from collections.abc import Iterable
+except ImportError:
+    # Python 2.7
+    from collections import Iterable
+
+
 if sys.version_info[0] > 2:
     buffer = memoryview
     xrange = range
@@ -284,6 +290,8 @@ _constructArrayFromAxistags = vigranumpy
 
 def _constructArrayFromOrder(cls, shape, dtype, order, init):
     axistags = VigraArray.defaultAxistags(len(shape), order)
+    if hasattr(dtype, "type"):
+        dtype = dtype.type
     return _constructArrayFromAxistags(cls, shape, dtype, axistags, init)
 
 def _constructArrayFromArray(cls, obj, dtype, order, init, axistags):
@@ -1262,7 +1270,7 @@ class VigraArray(numpy.ndarray):
         try:
             res = numpy.ndarray.__getitem__(self, index)
         except:
-            if not isinstance(index, collections.Iterable):
+            if not isinstance(index, Iterable):
                 raise
             #create temporary index without AxisInfor in order to use np.ndarray.__getitem__
             tmpindex = [None if isinstance(x, AxisInfo) else x for x in index]
