Commit 91b89f54 authored by Brett Cannon's avatar Brett Cannon

Have distutils.sysconfig close a file to remove ResourceWarnings coming up

during the build from setup.py.
parent c4405aad
...@@ -413,7 +413,8 @@ def _init_posix(): ...@@ -413,7 +413,8 @@ def _init_posix():
# load the installed pyconfig.h: # load the installed pyconfig.h:
try: try:
filename = get_config_h_filename() 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: except IOError as msg:
my_msg = "invalid Python installation: unable to open %s" % filename my_msg = "invalid Python installation: unable to open %s" % filename
if hasattr(msg, "strerror"): if hasattr(msg, "strerror"):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment