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:
Hugo van Kemenade 2021-09-08 13:07:40 +03:00 committed by GitHub
parent cb15afcccf
commit d003a5bd25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 34 additions and 139 deletions

View file

@ -17,19 +17,6 @@ class FileWrapper:
if hasattr(filelike,'close'):
self.close = filelike.close
def __getitem__(self,key):
import warnings
warnings.warn(
"FileWrapper's __getitem__ method ignores 'key' parameter. "
"Use iterator protocol instead.",
DeprecationWarning,
stacklevel=2
)
data = self.filelike.read(self.blksize)
if data:
return data
raise IndexError
def __iter__(self):
return self