mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Have distutils.sysconfig close a file to remove ResourceWarnings coming up
during the build from setup.py.
This commit is contained in:
parent
e857b29fdd
commit
5c035c0949
1 changed files with 2 additions and 1 deletions
|
@ -413,7 +413,8 @@ def _init_posix():
|
|||
# load the installed pyconfig.h:
|
||||
try:
|
||||
filename = get_config_h_filename()
|
||||
parse_config_h(io.open(filename), g)
|
||||
with open(filename) as file:
|
||||
parse_config_h(file, g)
|
||||
except IOError as msg:
|
||||
my_msg = "invalid Python installation: unable to open %s" % filename
|
||||
if hasattr(msg, "strerror"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue