From: Diane Trout Date: Mon, 6 Apr 2015 20:50:36 +0000 (-0700) Subject: Be more careful looking up keys when the fastqname is uninitialized. X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=af160817eda13fb25df0d653b3ad747ac89c2599 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. --- 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)