summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDasIch <dasdasich@gmail.com>2010-05-16 19:45:23 +0200
committerDasIch <dasdasich@gmail.com>2010-05-16 19:45:23 +0200
commitfb33cfbee735ecaea18879a8674eb96f19708228 (patch)
tree9290b0be1c40bda31c7acefd44e681d7d874e63b /utils
parent048f02e974c8d37bde6cb437b069c645e9b1f9b6 (diff)
downloadsphinx-fb33cfbee735ecaea18879a8674eb96f19708228.tar.gz
Fixed file opening
Diffstat (limited to 'utils')
-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 1b30f2dc..8eeadbf4 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