Skip to content
Snippets Groups Projects
Commit 702c4c31 authored by Cyril Danilevski's avatar Cyril Danilevski :scooter:
Browse files

Merge branch 'fix/test_get_dir_date'

parents 7788fc8f 032c3ac2
No related branches found
No related tags found
1 merge request!387Catch IndexError when getting dir creation date
......@@ -273,7 +273,7 @@ def get_dir_creation_date(directory: str, run: int,
cdate = fin['METADATA/creationDate'][0].decode()
cdate = datetime.datetime.strptime(cdate, "%Y%m%dT%H%M%SZ")
return cdate
except (IOError, ValueError):
except (IndexError, IOError, ValueError):
ntries -= 1
except KeyError: # The files are here, but it's an older dataset
return datetime.datetime.fromtimestamp(directory.stat().st_ctime)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment