summaryrefslogtreecommitdiffstats
path: root/Lib/tabnanny.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2011-08-22 06:19:19 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2011-08-22 06:19:19 (GMT)
commitc4a287114e2377772643e354fff5c388899cabff (patch)
tree86998b09aec41e2634825d47f72d61e78e11f491 /Lib/tabnanny.py
parent029ba2b8cd31728fb58dd082c44827a0703bff4a (diff)
downloadcpython-c4a287114e2377772643e354fff5c388899cabff.zip
cpython-c4a287114e2377772643e354fff5c388899cabff.tar.gz
cpython-c4a287114e2377772643e354fff5c388899cabff.tar.bz2
Fix #12811 by closing files promptly in tabnanny.check. Patch by Anthony Briggs.
Diffstat (limited to 'Lib/tabnanny.py')
-rwxr-xr-xLib/tabnanny.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py
index 46f8163..4a54f89 100755
--- a/Lib/tabnanny.py
+++ b/Lib/tabnanny.py
@@ -126,6 +126,9 @@ def check(file):
else: print(file, badline, repr(line))
return
+ finally:
+ f.close()
+
if verbose:
print("%r: Clean bill of health." % (file,))