mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
SF 698520: Iterator for urllib.URLOpener
Contributed by Brett Cannon.
This commit is contained in:
parent
e9e20a9838
commit
42182ebaf6
3 changed files with 9 additions and 1 deletions
|
@ -780,6 +780,10 @@ class addbase:
|
|||
self.readline = self.fp.readline
|
||||
if hasattr(self.fp, "readlines"): self.readlines = self.fp.readlines
|
||||
if hasattr(self.fp, "fileno"): self.fileno = self.fp.fileno
|
||||
if hasattr(self.fp, "__iter__"):
|
||||
self.__iter__ = self.fp.__iter__
|
||||
if hasattr(self.fp, "next"):
|
||||
self.next = self.fp.next
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s at %s whose fp = %s>' % (self.__class__.__name__,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue