diff --git a/src/zope/interface/_compat.py b/src/zope/interface/_compat.py index 9ea64442..fb147e15 100644 --- a/src/zope/interface/_compat.py +++ b/src/zope/interface/_compat.py @@ -22,12 +22,7 @@ import sys -PY38 = (3, 8) <= sys.version_info < (3, 9) -PY39 = (3, 9) <= sys.version_info < (3, 10) -PY310 = (3, 10) <= sys.version_info < (3, 11) -PY311 = (3, 11) <= sys.version_info < (3, 12) -PY312 = (3, 12) <= sys.version_info < (3, 13) -PY313 = (3, 13) <= sys.version_info < (3, 14) +PY314_OR_GREATER = sys.version_info >= (3, 14) def _normalize_name(name): diff --git a/src/zope/interface/common/builtins.py b/src/zope/interface/common/builtins.py index a24fee20..bb473de2 100644 --- a/src/zope/interface/common/builtins.py +++ b/src/zope/interface/common/builtins.py @@ -19,12 +19,7 @@ """ from zope.interface import classImplements -from zope.interface._compat import PY38 -from zope.interface._compat import PY39 -from zope.interface._compat import PY310 -from zope.interface._compat import PY311 -from zope.interface._compat import PY312 -from zope.interface._compat import PY313 +from zope.interface._compat import PY314_OR_GREATER from zope.interface.common import collections from zope.interface.common import io from zope.interface.common import numbers @@ -73,7 +68,7 @@ class ITextString(collections.ISequence): extra_classes = (str,) -if PY38 or PY39 or PY310 or PY311 or PY312 or PY313: +if not PY314_OR_GREATER: class IByteString(collections.IByteString): """ Interface for immutable byte strings. diff --git a/src/zope/interface/common/collections.py b/src/zope/interface/common/collections.py index 4d96a31c..25ab31d1 100644 --- a/src/zope/interface/common/collections.py +++ b/src/zope/interface/common/collections.py @@ -38,12 +38,7 @@ from collections import UserString from collections import abc -from zope.interface._compat import PY38 -from zope.interface._compat import PY39 -from zope.interface._compat import PY310 -from zope.interface._compat import PY311 -from zope.interface._compat import PY312 -from zope.interface._compat import PY313 +from zope.interface._compat import PY314_OR_GREATER from zope.interface.common import ABCInterface from zope.interface.common import optional @@ -196,7 +191,7 @@ class IMutableSequence(ISequence): extra_classes = (UserList,) -if PY38 or PY39 or PY310 or PY311 or PY312 or PY313: +if not PY314_OR_GREATER: class IByteString(ISequence): """ This unifies `bytes` and `bytearray`. diff --git a/src/zope/interface/common/tests/test_builtins.py b/src/zope/interface/common/tests/test_builtins.py index fe0755f2..3397839b 100644 --- a/src/zope/interface/common/tests/test_builtins.py +++ b/src/zope/interface/common/tests/test_builtins.py @@ -12,12 +12,7 @@ import unittest -from zope.interface._compat import PY38 -from zope.interface._compat import PY39 -from zope.interface._compat import PY310 -from zope.interface._compat import PY311 -from zope.interface._compat import PY312 -from zope.interface._compat import PY313 +from zope.interface._compat import PY314_OR_GREATER from zope.interface.common import builtins from . import VerifyClassMixin @@ -40,7 +35,7 @@ class TestVerifyClass(VerifyClassMixin, (builtins.IFile, ()), ] -if PY38 or PY39 or PY310 or PY311 or PY312 or PY313: +if not PY314_OR_GREATER: VERIFY_TESTS.append( (builtins.IByteString, (bytes,)) )