Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
702c4c31
Commit
702c4c31
authored
4 years ago
by
Cyril Danilevski
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix/test_get_dir_date'
parents
7788fc8f
032c3ac2
No related branches found
No related tags found
1 merge request
!387
Catch IndexError when getting dir creation date
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cal_tools/cal_tools/tools.py
+1
-1
1 addition, 1 deletion
cal_tools/cal_tools/tools.py
with
1 addition
and
1 deletion
cal_tools/cal_tools/tools.py
+
1
−
1
View file @
702c4c31
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment