8000 MAINT: Fix ResourceWarning new in Python 3.6. by charris · Pull Request #8178 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Fix ResourceWarning new in Python 3.6. #8178

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

Merged
merged 2 commits into from
Oct 20, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
MAINT: Fix ResourceWarning new in Python 3.6.
In Python 2.6 the process destructor emits a ResourceWarning if the
process has not terminated when destruction occurs. Fix by calling the
wait method before return.

The Popen class may be used as a context manager in Python 3.2+,
unfortunately that does not include 2.7.
  • Loading branch information
charris committed Oct 19, 2016
commit 8798f8df39ca0a9f0391ffc349431e1a93b97d38
1 change: 1 addition & 0 deletions numpy/distutils/tests/test_system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def have_compiler():
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
p.stdout.close()
p.stderr.close()
p.wait()
except OSError:
return False
return True
Expand Down
0