mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
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:
parent
0be33fe99b
commit
fc364cca7d
@ -515,7 +515,7 @@ def is_fileobject(obj):
|
|||||||
# check BytesIO case and maybe others
|
# check BytesIO case and maybe others
|
||||||
try:
|
try:
|
||||||
obj.fileno()
|
obj.fileno()
|
||||||
except io.UnsupportedOperation:
|
except (IOError, io.UnsupportedOperation):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user