Skip to content

Commit 8645da1

Browse files
committed
make deprecation warning active for two releases
1 parent 1738315 commit 8645da1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Doc/library/enum.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,8 @@ Private names are not converted to Enum members, but remain normal attributes.
12221222
:class:`Enum` members are instances of their :class:`Enum` class, and are
12231223
normally accessed as ``EnumClass.member``. In Python versions ``3.5`` to
12241224
``3.9`` you could access members from other members -- this practice was
1225-
discouraged, and in ``3.11`` :class:`Enum` will return to not allowing it,
1226-
while in ``3.10`` it will raise a :exc:`DeprecationWarning`::
1225+
discouraged, and in ``3.12`` :class:`Enum` will return to not allowing it,
1226+
while in ``3.10`` and ``3.11`` it will raise a :exc:`DeprecationWarning`::
12271227

12281228
>>> class FieldTypes(Enum):
12291229
... name = 0
@@ -1232,7 +1232,7 @@ while in ``3.10`` it will raise a :exc:`DeprecationWarning`::
12321232
...
12331233
>>> FieldTypes.value.size # doctest: +SKIP
12341234
DeprecationWarning: accessing one member from another is not supported,
1235-
and will be disabled in 3.11
1235+
and will be disabled in 3.12
12361236
<FieldTypes.size: 2>
12371237

12381238
.. versionchanged:: 3.5

Lib/enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def __get__(self, instance, ownerclass=None):
148148
import warnings
149149
warnings.warn(
150150
"accessing one member from another is not supported, "
151-
" and will be disabled in 3.11",
151+
" and will be disabled in 3.12",
152152
DeprecationWarning,
153153
stacklevel=2,
154154
)

Lib/test/test_enum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,7 @@ class Private(Enum):
21862186
self.assertEqual(Private._Private__major_, 'Hoolihan')
21872187

21882188
@unittest.skipUnless(
2189-
sys.version_info[:2] == (3, 10),
2189+
sys.version_info[:2] < (3, 12),
21902190
'member-member access now raises an exception',
21912191
)
21922192
def test_warning_for_member_from_member_access(self):
@@ -2198,7 +2198,7 @@ class Di(Enum):
21982198
self.assertIs(Di.NO, nope)
21992199

22002200
@unittest.skipUnless(
2201-
sys.version_info[:2] > (3, 10),
2201+
sys.version_info[:2] >= (3, 12),
22022202
'member-member access currently issues a warning',
22032203
)
22042204
def test_exception_for_member_from_member_access(self):

0 commit comments

Comments
 (0)