From 1a1141217a20b27003a87ae7dd12d98ccc8ba0b0 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Fri, 12 Oct 2018 13:17:50 +0100 Subject: [PATCH] RF: Avoiding another deprecation warning --- fsl/wrappers/wrapperutils.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/fsl/wrappers/wrapperutils.py b/fsl/wrappers/wrapperutils.py index 6728a2327..d3fc2db23 100644 --- a/fsl/wrappers/wrapperutils.py +++ b/fsl/wrappers/wrapperutils.py @@ -85,21 +85,22 @@ and returned:: """ -import itertools as it -import os.path as op -import os -import re -import sys -import glob -import random -import string -import fnmatch -import inspect -import logging -import tempfile -import warnings -import functools -import collections +import itertools as it +import os.path as op +import collections.abc as abc +import os +import re +import sys +import glob +import random +import string +import fnmatch +import inspect +import logging +import tempfile +import warnings +import functools + import six import nibabel as nib @@ -282,7 +283,7 @@ def applyArgStyle(style, valsep=None, argmap=None, valmap=None, **kwargs): # always returns a sequence def fmtval(val): - if isinstance(val, collections.Sequence) and \ + if isinstance(val, abc.Sequence) and \ not isinstance(val, six.string_types): val = [str(v) for v in val] -- GitLab