aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-09-29 17:09:11 +0300
committerBonfaceKilz2020-09-29 17:11:31 +0300
commitd6fa2ebf9b3c53daec63e2ccd23feb87335a1e81 (patch)
tree00e56ba7e60413eba195a4c8516a04dd9bd58bf8
parentce728fa92e02725202bca486e8336b2e1158f4ef (diff)
downloadgenenetwork2-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.
-rw-r--r--wqflask/wqflask/collect.py4
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: