Skip to content

Commit 9e5628a

Browse files
srittauemmatyping
andauthored
gh-140808: Remove __class_getitem__ from mailbox._ProxyFile (#140838)
Co-authored-by: Emma Smith <[email protected]>
1 parent 6d45cd8 commit 9e5628a

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Lib/mailbox.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,8 +2090,6 @@ def closed(self):
20902090
return False
20912091
return self._file.closed
20922092

2093-
__class_getitem__ = classmethod(GenericAlias)
2094-
20952093

20962094
class _PartialFile(_ProxyFile):
20972095
"""A read-only wrapper of part of a file."""

Lib/test/test_genericalias.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from functools import partial, partialmethod, cached_property
1818
from graphlib import TopologicalSorter
1919
from logging import LoggerAdapter, StreamHandler
20-
from mailbox import Mailbox, _PartialFile
20+
from mailbox import Mailbox
2121
try:
2222
import ctypes
2323
except ImportError:
@@ -117,7 +117,7 @@ class BaseTest(unittest.TestCase):
117117
Iterable, Iterator,
118118
Reversible,
119119
Container, Collection,
120-
Mailbox, _PartialFile,
120+
Mailbox,
121121
ContextVar, Token,
122122
Field,
123123
Set, MutableSet,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The internal class ``mailbox._ProxyFile`` is no longer a parameterized generic.

0 commit comments

Comments
 (0)