summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-10-29 22:36:08 (GMT)
committerBrett Cannon <bcannon@gmail.com>2010-10-29 22:36:08 (GMT)
commit5c035c0949bf7f0506191e1a689d52666e186d57 (patch)
tree45859c963c09fad20a6869a8cf9f1d3006bb7b9b
parente857b29fdd7d9dd0f300875f20635431793a1d33 (diff)
downloadcpython-5c035c0949bf7f0506191e1a689d52666e186d57.zip
cpython-5c035c0949bf7f0506191e1a689d52666e186d57.tar.gz
cpython-5c035c0949bf7f0506191e1a689d52666e186d57.tar.bz2
Have distutils.sysconfig close a file to remove ResourceWarnings coming up
during the build from setup.py.
-rw-r--r--Lib/distutils/sysconfig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 6b5daa5..8b55f21 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -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"):