]> git.phdru.name Git - bookmarks_db.git/commitdiff
Always close the input file.
authorOleg Broytman <phd@phdru.name>
Sat, 22 Dec 2007 16:59:28 +0000 (16:59 +0000)
committerOleg Broytman <phd@phdru.name>
Sat, 22 Dec 2007 16:59:28 +0000 (16:59 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@123 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/parse_html_beautifulsoup.py

index 5f010ad698e894e63d86515fa2a0111ad926da4d..d73e4c313a62a67570eb190dac14d5198499ef1b 100644 (file)
@@ -55,7 +55,8 @@ def parse_html(filename, charset=None):
       root = BadDeclParser(infile, fromEncoding=charset)
    except TypeError:
       return None
-   infile.close()
+   finally:
+      infile.close()
 
    _charset = root.originalEncoding
    try: