From af160817eda13fb25df0d653b3ad747ac89c2599 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Mon, 6 Apr 2015 13:50:36 -0700 Subject: [PATCH] Be more careful looking up keys when the fastqname is uninitialized. By removing the default return of None from getitem, the is_valid test failed when the object was uninitialized. --- htsworkflow/submission/fastqname.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htsworkflow/submission/fastqname.py b/htsworkflow/submission/fastqname.py index 7f74f22..b3d232b 100644 --- a/htsworkflow/submission/fastqname.py +++ b/htsworkflow/submission/fastqname.py @@ -61,7 +61,7 @@ class FastqName(collections.Mapping): elif k == 'compression_extension': if self[k] not in (None, '', '.gz', '.bz2'): return False - elif self[k] is None: + elif getattr(self, k, None) is None: return False return True is_valid = property(_is_valid) -- 2.30.2