Added KeyError check
authorMike Jackson <michaelj@epcc.ed.ac.uk>
Tue, 2 Apr 2013 16:49:55 +0000 (09:49 -0700)
committerW. Trevor King <wking@tremily.us>
Fri, 1 Nov 2013 04:21:50 +0000 (21:21 -0700)
testing/cdna.py

index 6fdfecaaaebba090b2c873581db7dc8d1f0d79f4..a1f7e033e887875f1ffbd3f601c531c9ef9f59b7 100755 (executable)
@@ -13,4 +13,6 @@ def complement(sequence):
             cdna += COMPLEMENTS[ch]
         return cdna
     except TypeError:
-        print 'The input is not a sequence e.g. a string or list'
+        raise ValueError('The input is not a sequence e.g. a string or list')
+    except KeyError:
+        raise ValueError('The input is not a sequence of G,T,C,A')