correct way of importing for newer python versions

This commit is contained in:
Martin Diehl 2019-12-07 20:07:46 +01:00
parent 3aab154cdb
commit e283acd606
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import os
import sys import sys
from optparse import OptionParser from optparse import OptionParser
import re import re
import collections from collections.abc import Iterable
import math # noqa import math # noqa
import scipy # noqa import scipy # noqa
@ -18,7 +18,7 @@ scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
def listify(x): def listify(x):
return x if isinstance(x, collections.Iterable) else [x] return x if isinstance(x, Iterable) else [x]
# -------------------------------------------------------------------- # --------------------------------------------------------------------