Skip to content

Commit

Permalink
by default if filename is not a steam, raise io error as well
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed May 10, 2015
1 parent 5fbd404 commit a268ae8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyexcel_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def load_data(filename,
extension = filename.split(".")[-1]
else:
extension = FILE_FORMAT_CSV
if not is_string(type(filename)):
if not is_string(type(filename)) and not isstream(filename):
# Not accepting non string file name
raise IOError(MESSAGE_ERROR_03)
if extension in READERS:
Expand Down Expand Up @@ -215,7 +215,7 @@ def get_writer(filename, file_type=None, **keywords):
extension = filename.split(".")[-1]
else:
extension = FILE_FORMAT_CSV
if not is_string(type(filename)):
if not is_string(type(filename)) and not isstream(filename):
# Not accepting non string file name
raise IOError(MESSAGE_ERROR_03)
if extension in WRITERS:
Expand Down

0 comments on commit a268ae8

Please sign in to comment.