From e01c72d66eed4b6aeb34d530aa0ebb2a5c9a89a6 Mon Sep 17 00:00:00 2001 From: Mike Jackson Date: Tue, 2 Apr 2013 09:49:55 -0700 Subject: [PATCH] Added KeyError check --- testing/cdna.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/cdna.py b/testing/cdna.py index 6fdfeca..a1f7e03 100755 --- a/testing/cdna.py +++ b/testing/cdna.py @@ -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') -- 2.26.2