diff options
Diffstat (limited to 'lib/spack/external/_pytest/python_api.py')
-rw-r--r-- | lib/spack/external/_pytest/python_api.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/external/_pytest/python_api.py b/lib/spack/external/_pytest/python_api.py index cfc01193b0..a931b4d2c7 100644 --- a/lib/spack/external/_pytest/python_api.py +++ b/lib/spack/external/_pytest/python_api.py @@ -398,7 +398,10 @@ def approx(expected, rel=None, abs=None, nan_ok=False): __ https://docs.python.org/3/reference/datamodel.html#object.__ge__ """ - from collections import Mapping, Sequence + if sys.version_info >= (3, 3): + from collections.abc import Mapping, Sequence + else: + from collections import Mapping, Sequence from _pytest.compat import STRING_TYPES as String # Delegate the comparison to a class that knows how to deal with the type |