summaryrefslogtreecommitdiff
path: root/scripts/importer.py
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2014-10-15 21:06:52 +0200
committerFlorian Bruhin <git@the-compiler.org>2014-10-15 21:06:52 +0200
commit0a7ff8db093f81100798ed502c43e43fc9979a67 (patch)
tree4ad62a53f65e30c3a378fe816d1db1a589834e21 /scripts/importer.py
parent17816bdab2c69fedb71c0aa445fe9d6026fe126f (diff)
downloadqutebrowser-0a7ff8db093f81100798ed502c43e43fc9979a67.tar.gz
qutebrowser-0a7ff8db093f81100798ed502c43e43fc9979a67.zip
importer: Use with-block to open file.
Diffstat (limited to 'scripts/importer.py')
-rwxr-xr-xscripts/importer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/importer.py b/scripts/importer.py
index 403e9a52b..67ae83885 100755
--- a/scripts/importer.py
+++ b/scripts/importer.py
@@ -50,8 +50,8 @@ def get_args():
def import_chromium(bookmarks_file):
"""Import bookmarks from a HTML file generated by Chromium."""
import bs4
-
- soup = bs4.BeautifulSoup(open(bookmarks_file, encoding='utf-8'))
+ with open(bookmarks_file, encoding='utf-8') as f:
+ soup = bs4.BeautifulSoup(f)
html_tags = soup.findAll('a')