diff options
| author | Éric Araujo <merwok@netwok.org> | 2010-11-06 02:58:56 +0000 |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2010-11-06 02:58:56 +0000 |
| commit | c705a947d03d1505af6e1aeed5db58860fd5b717 (patch) | |
| tree | 5305ccb834565479e798a47522f7d6760b556e80 /cygwinccompiler.py | |
| parent | 1208ea17d6e97abffe76f3994d8575be5db3582f (diff) | |
| download | python-setuptools-git-c705a947d03d1505af6e1aeed5db58860fd5b717.tar.gz | |
Merged revisions 86223-86224,86226,86234 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86223 | eric.araujo | 2010-11-06 00:51:56 +0100 (sam., 06 nov. 2010) | 2 lines
Always close files in distutils code and tests (#10252).
........
r86224 | eric.araujo | 2010-11-06 00:58:34 +0100 (sam., 06 nov. 2010) | 2 lines
Add missing entry for r86223.
........
r86226 | eric.araujo | 2010-11-06 00:59:32 +0100 (sam., 06 nov. 2010) | 2 lines
Of course, I forgot one file in r86223.
........
r86234 | eric.araujo | 2010-11-06 03:10:32 +0100 (sam., 06 nov. 2010) | 2 lines
Also close file descriptors from os.popen and subprocess.Popen
........
Diffstat (limited to 'cygwinccompiler.py')
| -rw-r--r-- | cygwinccompiler.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cygwinccompiler.py b/cygwinccompiler.py index 85043718..95fa3ed3 100644 --- a/cygwinccompiler.py +++ b/cygwinccompiler.py @@ -350,11 +350,14 @@ def check_config_h(): # let's see if __GNUC__ is mentioned in python.h fn = sysconfig.get_config_h_filename() try: - with open(fn) as config_h: + config_h = open(fn) + try: if "__GNUC__" in config_h.read(): return CONFIG_H_OK, "'%s' mentions '__GNUC__'" % fn else: return CONFIG_H_NOTOK, "'%s' does not mention '__GNUC__'" % fn + finally: + config_h.close() except IOError as exc: return (CONFIG_H_UNCERTAIN, "couldn't read '%s': %s" % (fn, exc.strerror)) |
