Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventReport.stat file not found error handling #281

Merged
merged 7 commits into from
Dec 4, 2023
5 changes: 4 additions & 1 deletion abipy/flowtk/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ def __init__(self, filename: str, events=None):
events: List of Event objects
"""
self.filename = os.path.abspath(filename)
self.stat = os.stat(self.filename)
try:
self.stat = os.stat(self.filename)
except FileNotFoundError:
self.stat = None
self.start_datetime, self.end_datetime = None, None

self._events = []
Expand Down
Loading