diff options
author | Florian Bruhin <git@the-compiler.org> | 2017-07-04 22:16:21 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2017-07-04 22:16:21 +0200 |
commit | 725d4a44f01de99fab5d9e4404a9123f40ec8915 (patch) | |
tree | 7d87d97e1836de9bc1338c703d60fa73911a1db9 | |
parent | c424a745d8d039b02f62dc9b545693b9025012e6 (diff) | |
download | qutebrowser-725d4a44f01de99fab5d9e4404a9123f40ec8915.tar.gz qutebrowser-725d4a44f01de99fab5d9e4404a9123f40ec8915.zip |
build_release: Don't fail if hdiutil detach fails
-rwxr-xr-x | scripts/dev/build_release.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 5c2c5f168..27d7b04b8 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -149,15 +149,19 @@ def build_osx(): os.rename('qutebrowser.dmg', dmg_name) utils.print_title("Running smoke test") - with tempfile.TemporaryDirectory() as tmpdir: - subprocess.check_call(['hdiutil', 'attach', dmg_name, - '-mountpoint', tmpdir]) - try: - binary = os.path.join(tmpdir, 'qutebrowser.app', 'Contents', - 'MacOS', 'qutebrowser') - smoke_test(binary) - finally: - subprocess.check_call(['hdiutil', 'detach', tmpdir]) + + try: + with tempfile.TemporaryDirectory() as tmpdir: + subprocess.check_call(['hdiutil', 'attach', dmg_name, + '-mountpoint', tmpdir]) + try: + binary = os.path.join(tmpdir, 'qutebrowser.app', 'Contents', + 'MacOS', 'qutebrowser') + smoke_test(binary) + finally: + subprocess.call(['hdiutil', 'detach', tmpdir]) + except PermissionError as e: + print("Failed to remove tempdir: {}".format(e)) return [(dmg_name, 'application/x-apple-diskimage', 'OS X .dmg')] |