summaryrefslogtreecommitdiff
path: root/Lib/sysconfig.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-14 21:15:17 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-14 21:15:17 +0000
commitb86680e299d7429532518a496031cb96aa2ea659 (patch)
treec908511dfb569e7a640ed65cc412f1556f0ecc12 /Lib/sysconfig.py
parentd9f57630fed16bd1e97737f8afc22b5cc6645769 (diff)
downloadcpython-git-b86680e299d7429532518a496031cb96aa2ea659.tar.gz
Explicitly close some files (from issue #10093)
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r--Lib/sysconfig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index f7c647c148..9b804e6b88 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -333,7 +333,8 @@ def _init_posix(vars):
# load the installed pyconfig.h:
config_h = get_config_h_filename()
try:
- parse_config_h(open(config_h), vars)
+ with open(config_h) as f:
+ parse_config_h(f, vars)
except IOError as e:
msg = "invalid Python installation: unable to open %s" % config_h
if hasattr(e, "strerror"):