diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/database.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index 0efaab9eb0..650ab48492 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -1454,11 +1454,12 @@ class Database(object): rec.spec.name) != known: continue - inst_date = datetime.datetime.fromtimestamp( - rec.installation_time - ) - if not (start_date < inst_date < end_date): - continue + if start_date or end_date: + inst_date = datetime.datetime.fromtimestamp( + rec.installation_time + ) + if not (start_date < inst_date < end_date): + continue if (query_spec is any or rec.spec.satisfies(query_spec, strict=True)): |