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/dev/build_release.py | |
parent | b9d58034d11674c65dfc5db0d424017cef09ff56 (diff) | |
download | qutebrowser-ed2342a43093a137f5260923eeb5946f4bbb65ee.tar.gz qutebrowser-ed2342a43093a137f5260923eeb5946f4bbb65ee.zip |
pylint: Handle consider-using-with
Diffstat (limited to 'scripts/dev/build_release.py')
-rwxr-xr-x | scripts/dev/build_release.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 4961cbdc8..241d27f1d 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -489,15 +489,15 @@ def build_sdist(): dist_file = os.path.join('dist', dist_files[0]) subprocess.run(['gpg', '--detach-sign', '-a', dist_file], check=True) - tar = tarfile.open(dist_file) by_ext = collections.defaultdict(list) - for tarinfo in tar.getmembers(): - if not tarinfo.isfile(): - continue - name = os.sep.join(tarinfo.name.split(os.sep)[1:]) - _base, ext = os.path.splitext(name) - by_ext[ext].append(name) + with tarfile.open(dist_file) as tar: + for tarinfo in tar.getmembers(): + if not tarinfo.isfile(): + continue + name = os.sep.join(tarinfo.name.split(os.sep)[1:]) + _base, ext = os.path.splitext(name) + by_ext[ext].append(name) assert '.pyc' not in by_ext |