summaryrefslogtreecommitdiff
path: root/utils/check_sources.py
diff options
context:
space:
mode:
authorDaniel Neuhäuser <ich@danielneuhaeuser.de>2010-05-16 19:45:23 +0200
committerDaniel Neuhäuser <ich@danielneuhaeuser.de>2010-05-16 19:45:23 +0200
commitad29ab1b860d13fcd0dacd2395f8f3dea5c2370a (patch)
tree9290b0be1c40bda31c7acefd44e681d7d874e63b /utils/check_sources.py
parentd8425102e27723839fc2c5078ab96c7752de1207 (diff)
downloadsphinx-git-ad29ab1b860d13fcd0dacd2395f8f3dea5c2370a.tar.gz
Fixed file opening
Diffstat (limited to 'utils/check_sources.py')
-rwxr-xr-xutils/check_sources.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/check_sources.py b/utils/check_sources.py
index 1b30f2dc5..8eeadbf4b 100755
--- a/utils/check_sources.py
+++ b/utils/check_sources.py
@@ -212,7 +212,10 @@ def main(argv):
try:
f = open(fn, 'r')
- lines = list(f)
+ try:
+ lines = list(f)
+ finally:
+ f.close()
except (IOError, OSError), err:
print "%s: cannot open: %s" % (fn, err)
num += 1