Fix check for file-like objects

The `is_fileobject()` function in utils.py would break when the respones
was a wrapped `HTTPResponse`'s `raw` attribute. This just adds the
`IOError` exception type to the `is_fileobject()` function so that the
response can be streamed normally.

Fixes #805
This commit is contained in:
Paul J. Davis 2014-06-26 14:31:40 -05:00
parent 0be33fe99b
commit fc364cca7d

View File

@ -515,7 +515,7 @@ def is_fileobject(obj):
# check BytesIO case and maybe others
try:
obj.fileno()
except io.UnsupportedOperation:
except (IOError, io.UnsupportedOperation):
return False
return True