Skip to content

Commit

Permalink
trying to fix py2
Browse files Browse the repository at this point in the history
  • Loading branch information
woodsjc committed Apr 17, 2017
1 parent 4397e25 commit 50b14fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions finsymbols/symbol_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ def get_symbol_list(symbol_data, exchange_name):


def save_file(file_path, file_data):
with open(file_path, "wb") as saved_file:
saved_file.write(file_data.encode('utf-8'))
if isinstance(file_data, str):
with open(file_path, "w") as saved_file:
saved_file.write(file_data)
elif isinstance(file_data, bytes):
with open(file_path, "wb") as saved_file:
saved_file.write(file_data.encode('utf-8'))


def get_exchange_url(exchange):
Expand Down

0 comments on commit 50b14fd

Please sign in to comment.