From 187053026f4a5c40edefbc2344df7ea859c4b612 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Thu, 29 Aug 2019 16:10:09 +0200 Subject: [PATCH] Better detection of missing taxonomy --- python/obitools3/commands/annotate.pyx | 2 +- python/obitools3/commands/grep.pyx | 2 +- python/obitools3/commands/stats.pyx | 2 +- python/obitools3/commands/uniq.pyx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) mode change 100755 => 100644 python/obitools3/commands/grep.pyx diff --git a/python/obitools3/commands/annotate.pyx b/python/obitools3/commands/annotate.pyx index f93960a..2f76449 100755 --- a/python/obitools3/commands/annotate.pyx +++ b/python/obitools3/commands/annotate.pyx @@ -306,7 +306,7 @@ def run(config): # Open taxonomy if there is one if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None: 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") taxo = taxo_uri[1] else : diff --git a/python/obitools3/commands/grep.pyx b/python/obitools3/commands/grep.pyx old mode 100755 new mode 100644 index e41867a..a32995d --- a/python/obitools3/commands/grep.pyx +++ b/python/obitools3/commands/grep.pyx @@ -290,7 +290,7 @@ def run(config): if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None: 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") taxo = taxo_uri[1] else : diff --git a/python/obitools3/commands/stats.pyx b/python/obitools3/commands/stats.pyx index 98341f5..f9a181d 100755 --- a/python/obitools3/commands/stats.pyx +++ b/python/obitools3/commands/stats.pyx @@ -146,7 +146,7 @@ def run(config): if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None: 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") taxo = taxo_uri[1] else : diff --git a/python/obitools3/commands/uniq.pyx b/python/obitools3/commands/uniq.pyx index d733492..d093cb7 100644 --- a/python/obitools3/commands/uniq.pyx +++ b/python/obitools3/commands/uniq.pyx @@ -526,7 +526,7 @@ def run(config): if 'taxoURI' in config['obi'] and config['obi']['taxoURI'] is not None: 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) taxo = taxo_uri[1] else :