diff options
Diffstat (limited to 'Lib/distutils/cygwinccompiler.py')
-rw-r--r-- | Lib/distutils/cygwinccompiler.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py index 2dabc0f..a1ee815 100644 --- a/Lib/distutils/cygwinccompiler.py +++ b/Lib/distutils/cygwinccompiler.py @@ -382,8 +382,10 @@ def check_config_h(): # It would probably better to read single lines to search. # But we do this only once, and it is fast enough f = open(fn) - s = f.read() - f.close() + try: + s = f.read() + finally: + f.close() except IOError, exc: # if we can't read this file, we cannot say it is wrong |