diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-12-02 17:30:47 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-12-02 17:30:47 +0100 |
commit | ed2342a43093a137f5260923eeb5946f4bbb65ee (patch) | |
tree | c27fc570fe52e56000c5d0963a5a8d77de89abd1 /scripts/hostblock_blame.py | |
parent | b9d58034d11674c65dfc5db0d424017cef09ff56 (diff) | |
download | qutebrowser-ed2342a43093a137f5260923eeb5946f4bbb65ee.tar.gz qutebrowser-ed2342a43093a137f5260923eeb5946f4bbb65ee.zip |
pylint: Handle consider-using-with
Diffstat (limited to 'scripts/hostblock_blame.py')
-rw-r--r-- | scripts/hostblock_blame.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/hostblock_blame.py b/scripts/hostblock_blame.py index 38acaa58d..b18c62925 100644 --- a/scripts/hostblock_blame.py +++ b/scripts/hostblock_blame.py @@ -41,8 +41,8 @@ def main(): for url in configdata.DATA['content.blocking.hosts.lists'].default: print("checking {}...".format(url)) - raw_file = urllib.request.urlopen(url) - byte_io = io.BytesIO(raw_file.read()) + with urllib.request.urlopen(url) as raw_file: + byte_io = io.BytesIO(raw_file.read()) f = hostblock.get_fileobj(byte_io) for line in f: line = line.decode('utf-8') |