Better detection of missing taxonomy

This commit is contained in:
Celine Mercier
2019-08-29 16:10:09 +02:00
parent dcf8cf1d64
commit 187053026f
4 changed files with 4 additions and 4 deletions

View File

@ -306,7 +306,7 @@ def run(config):
# Open taxonomy if there is one # Open taxonomy if there is one
if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None: if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None:
taxo_uri = open_uri(config['obi']['taxoURI']) taxo_uri = open_uri(config['obi']['taxoURI'])
if taxo_uri is None: if taxo_uri is None or taxo_uri[2] == bytes:
raise Exception("Couldn't open taxonomy") raise Exception("Couldn't open taxonomy")
taxo = taxo_uri[1] taxo = taxo_uri[1]
else : else :

2
python/obitools3/commands/grep.pyx Executable file → Normal file
View File

@ -290,7 +290,7 @@ def run(config):
if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None: if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None:
taxo_uri = open_uri(config["obi"]["taxoURI"]) taxo_uri = open_uri(config["obi"]["taxoURI"])
if taxo_uri is None: if taxo_uri is None or taxo_uri[2] == bytes:
raise Exception("Couldn't open taxonomy") raise Exception("Couldn't open taxonomy")
taxo = taxo_uri[1] taxo = taxo_uri[1]
else : else :

View File

@ -146,7 +146,7 @@ def run(config):
if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None: if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None:
taxo_uri = open_uri(config['obi']['taxoURI']) taxo_uri = open_uri(config['obi']['taxoURI'])
if taxo_uri is None: if taxo_uri is None or taxo_uri[2] == bytes:
raise Exception("Couldn't open taxonomy") raise Exception("Couldn't open taxonomy")
taxo = taxo_uri[1] taxo = taxo_uri[1]
else : else :

View File

@ -526,7 +526,7 @@ def run(config):
if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None: if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None:
taxo_uri = open_uri(config['obi']['taxoURI']) taxo_uri = open_uri(config['obi']['taxoURI'])
if taxo_uri is None: if taxo_uri is None or taxo_uri[2] == bytes:
raise RollbackException("Couldn't open taxonomy, rollbacking view", o_view) raise RollbackException("Couldn't open taxonomy, rollbacking view", o_view)
taxo = taxo_uri[1] taxo = taxo_uri[1]
else : else :