Merge pull request #806 from benoitc/805-bug-is-fileobj

Fix check for file-like objects
This commit is contained in:
Randall Leeds 2014-06-26 13:19:48 -07:00
commit 7b7f3e6c0b

View File

@ -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