diff options
Diffstat (limited to 'scripts/dev')
-rwxr-xr-x | scripts/dev/build_release.py | 14 | ||||
-rwxr-xr-x | scripts/dev/update_3rdparty.py | 10 |
2 files changed, 12 insertions, 12 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 diff --git a/scripts/dev/update_3rdparty.py b/scripts/dev/update_3rdparty.py index 88f56b7f3..60b72d110 100755 --- a/scripts/dev/update_3rdparty.py +++ b/scripts/dev/update_3rdparty.py @@ -160,11 +160,11 @@ def test_dicts(): print('Testing dictionary {}... '.format(lang.code), end='') lang_url = urllib.parse.urljoin(dictcli.API_URL, lang.remote_filename) request = urllib.request.Request(lang_url, method='HEAD') - response = urllib.request.urlopen(request) - if response.status == 200: - print('OK') - else: - print('ERROR: {}'.format(response.status)) + with urllib.request.urlopen(request) as response: + if response.status == 200: + print('OK') + else: + print('ERROR: {}'.format(response.status)) def run(nsis=False, ace=False, pdfjs=True, fancy_dmg=False, pdfjs_version=None, |