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

Suppress IOError when closing the temporary file used for capturing streams in Python 2.7 #3305

Merged

Conversation

nicoddemus
Copy link
Member

Fix #2370

if six.PY2:
try:
f.close()
except IOError:
Copy link
Member Author

Choose a reason for hiding this comment

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

Decided to be conservative and only ignore IOError under Python 2, but if others think otherwise we can ignore the exception always.

Copy link
Member

Choose a reason for hiding this comment

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

i like it ^^

if six.PY2:
try:
f.close()
except IOError:
Copy link
Member

Choose a reason for hiding this comment

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

i like it ^^

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 92.563% when pulling 9517c3a on nicoddemus:2370-tmpfile-close-py27 into 2612d96 on pytest-dev:master.

@RonnyPfannschmidt RonnyPfannschmidt merged commit b2b629f into pytest-dev:master Mar 14, 2018
@nicoddemus nicoddemus deleted the 2370-tmpfile-close-py27 branch March 14, 2018 20:19
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.

3 participants