diff --git a/nanshe/io/xjson.py b/nanshe/io/xjson.py index 4414f070..1bf33421 100644 --- a/nanshe/io/xjson.py +++ b/nanshe/io/xjson.py @@ -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: diff --git a/nanshe/io/xtiff.py b/nanshe/io/xtiff.py index 30186127..97d1a0e9 100644 --- a/nanshe/io/xtiff.py +++ b/nanshe/io/xtiff.py @@ -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