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

Fix h5pyf not found when flushing HDF5 output processor #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arryon
Copy link
Member

@arryon arryon commented Sep 29, 2017

In case finalize is called on the file output processor, sometimes self.h5pyf is not found. In this case, using hasattr prevents Python throwing an error. For convenience, I've created a class method that can be called to flush and close the file handle

Copy link

@RonaldAJ RonaldAJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if self.h5pyf is None? I think this is still a possible value.

In addition I found:https://hynek.me/articles/hasattr/ showing other potential risks.

@arryon
Copy link
Member Author

arryon commented Sep 29, 2017

Good point, thanks for the resource. I will update the PR accordingly

@arryon
Copy link
Member Author

arryon commented Nov 7, 2017

I've updated the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants