diff options
author | BonfaceKilz | 2020-09-29 17:09:11 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-09-29 17:11:31 +0300 |
commit | d6fa2ebf9b3c53daec63e2ccd23feb87335a1e81 (patch) | |
tree | 00e56ba7e60413eba195a4c8516a04dd9bd58bf8 /wqflask | |
parent | ce728fa92e02725202bca486e8336b2e1158f4ef (diff) | |
download | genenetwork2-d6fa2ebf9b3c53daec63e2ccd23feb87335a1e81.tar.gz |
Add check for bytes
* wqflask/wqflask/collect.py (process_traits): Check whether the
passed "unprocessed_traits" is a byte otherwise an error is generated
when bytes(the default) are passed.
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/collect.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index 15383603..e7dac72a 100644 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -35,7 +35,9 @@ from utility.logger import getLogger logger = getLogger(__name__) def process_traits(unprocessed_traits): - if isinstance(unprocessed_traits, str): + if isinstance(unprocessed_traits, bytes): + unprocessed_traits = unprocessed_traits.decode('utf-8').split(",") + else: # It's a string unprocessed_traits = unprocessed_traits.split(",") traits = set() for trait in unprocessed_traits: |