Commit ab75d5de authored by Terry Jan Reedy's avatar Terry Jan Reedy

Tempfile.py: stop buildbot warning about using deprecated xreadlines.

The slightly odd behavior (the validity of passing a sizehint depends on the
type of self._file) was kept to avoid breaking code that depends on it.
Test_tempfile.test_xreadlines passes (along with everything else).
parent 1d6e98e6
...@@ -612,7 +612,7 @@ class SpooledTemporaryFile: ...@@ -612,7 +612,7 @@ class SpooledTemporaryFile:
return rv return rv
def xreadlines(self, *args): def xreadlines(self, *args):
try: if hasattr(self._file, 'xreadlines'): # real file
return self._file.xreadlines(*args) return iter(self._file)
except AttributeError: else: # StringIO()
return iter(self._file.readlines(*args)) return iter(self._file.readlines(*args))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment