mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-45132 Remove deprecated __getitem__ methods (GH-28225)
Remove deprecated __getitem__ methods of xml.dom.pulldom.DOMEventStream, wsgiref.util.FileWrapper and fileinput.FileInput, deprecated since Python 3.9.
This commit is contained in:
parent
cb15afcccf
commit
d003a5bd25
11 changed files with 34 additions and 139 deletions
|
@ -216,19 +216,6 @@ class DOMEventStream:
|
|||
self.parser.setFeature(xml.sax.handler.feature_namespaces, 1)
|
||||
self.parser.setContentHandler(self.pulldom)
|
||||
|
||||
def __getitem__(self, pos):
|
||||
import warnings
|
||||
warnings.warn(
|
||||
"DOMEventStream's __getitem__ method ignores 'pos' parameter. "
|
||||
"Use iterator protocol instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2
|
||||
)
|
||||
rc = self.getEvent()
|
||||
if rc:
|
||||
return rc
|
||||
raise IndexError
|
||||
|
||||
def __next__(self):
|
||||
rc = self.getEvent()
|
||||
if rc:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue