From ad29ab1b860d13fcd0dacd2395f8f3dea5c2370a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuh=C3=A4user?= Date: Sun, 16 May 2010 19:45:23 +0200 Subject: Fixed file opening --- utils/check_sources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'utils/check_sources.py') 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 -- cgit v1.2.1