Commit 7d4fc816 authored by Mathieu Giraud's avatar Mathieu Giraud

*.py: code cleaning, KeyError exceptions

Thanks to landscape.io.
parent c7d63a16
......@@ -20,7 +20,7 @@ def revcomp(seq):
for nucl in seq[::-1]:
try:
rc += COMPLEMENT_NUCLEOTIDE[nucl.upper()]
except:
except KeyError:
sys.stderr.write("! Unknown nucleotide : '%s' " % nucl + seq)
rc += 'N'
return rc
......
......@@ -62,7 +62,7 @@ class Analysis(VidjilJson):
if i:
try:
return i['tag']
except:
except KeyError:
return None
return None
......@@ -98,7 +98,7 @@ def compare(data1, data2, args):
try:
w = o[clone]
other_clones += [w]
except:
except KeyError:
continue
if not w:
continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment