Skip to content

Commit

Permalink
Check isinstance of unicode or bytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Feb 29, 2016
1 parent d05a4ce commit 2a22252
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions nanshe/io/xjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ def ascii_encode_list(data, json_dict=json_dict):
new_each_value = ascii_encode_dict(new_each_value)
elif isinstance(new_each_value, list):
new_each_value = ascii_encode_list(new_each_value)
elif isinstance(new_each_value, unicode) or \
isinstance(new_each_value, str):
elif isinstance(new_each_value, (bytes, unicode)):
new_each_value = ascii_encode_str(new_each_value)

if new_each_value is not None:
Expand Down
2 changes: 1 addition & 1 deletion nanshe/io/xtiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def convert_tiffs(new_tiff_filenames,
)))

# if it is only a single str, make it a singleton list
if isinstance(new_tiff_filenames, str):
if isinstance(new_tiff_filenames, (bytes, unicode)):
new_tiff_filenames = [new_tiff_filenames]

# Expand any regex in path names
Expand Down

0 comments on commit 2a22252

Please sign in to comment.