diff --git a/pytools/tag.py b/pytools/tag.py index 822e55d1b5c556758ea8bb0c42841c552cd7e6d6..7e4f32f8de94ec4922d21d0aa6ae24540aee8fba 100644 --- a/pytools/tag.py +++ b/pytools/tag.py @@ -28,7 +28,6 @@ Internal stuff that is only here because the documentation tool wants it A type variable with lower bound :class:`Taggable`. """ -import sys from dataclasses import dataclass from typing import ( # noqa: F401 Any, FrozenSet, Iterable, Set, Tuple, Type, TypeVar, Union) @@ -378,23 +377,18 @@ _depr_name_to_replacement_and_obj = { } -if sys.version_info >= (3, 7): - def __getattr__(name): - replacement_and_obj = _depr_name_to_replacement_and_obj.get(name, None) - if replacement_and_obj is not None: - replacement, obj, year = replacement_and_obj - from warnings import warn - warn(f"'arraycontext.{name}' is deprecated. " - f"Use '{replacement}' instead. " - f"'arraycontext.{name}' will continue to work until {year}.", - DeprecationWarning, stacklevel=2) - return obj - else: - raise AttributeError(name) -else: - TagsType = FrozenSet[Tag] - TagOrIterableType = ToTagSetConvertible - T_co = TypeVar("TaggableT", bound="Taggable") +def __getattr__(name): + replacement_and_obj = _depr_name_to_replacement_and_obj.get(name, None) + if replacement_and_obj is not None: + replacement, obj, year = replacement_and_obj + from warnings import warn + warn(f"'pytools.tag.{name}' is deprecated. " + f"Use '{replacement}' instead. " + f"'pytools.tag.{name}' will continue to work until {year}.", + DeprecationWarning, stacklevel=2) + return obj + else: + raise AttributeError(name) # }}} diff --git a/pytools/test/test_pytools.py b/pytools/test/test_pytools.py index 7e1fe3ace555aed573417bc04b596773b691acd1..991871f294e5d29f5aac880d0759f21b73ac3923 100644 --- a/pytools/test/test_pytools.py +++ b/pytools/test/test_pytools.py @@ -31,7 +31,6 @@ logger = logging.getLogger(__name__) from typing import FrozenSet -@pytest.mark.skipif("sys.version_info < (2, 5)") def test_memoize_method_clear(): from pytools import memoize_method