From e5b531225040f8e3cfa6342a4d2860b8902c7058 Mon Sep 17 00:00:00 2001 From: Allen Wittenauer Date: Wed, 14 Jun 2023 21:59:05 -0700 Subject: [PATCH] Fix fresh installs (#854) --- nowplaying/upgrade.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/nowplaying/upgrade.py b/nowplaying/upgrade.py index 0d46edf6..3d213d23 100644 --- a/nowplaying/upgrade.py +++ b/nowplaying/upgrade.py @@ -309,16 +309,14 @@ def upgrade(bundledir=None): try: upgradebin = nowplaying.upgradeutils.UpgradeBinary() - data = upgradebin.get_upgrade_data() - if not data: - return - dialog = UpgradeDialog() - dialog.fill_it_in(upgradebin.myversion, data['tag_name']) - if dialog.exec(): - webbrowser.open(data['html_url']) - logging.info('User wants to upgrade; exiting') - sys.exit(0) + if data:= upgradebin.get_upgrade_data(): + dialog = UpgradeDialog() + dialog.fill_it_in(upgradebin.myversion, data['tag_name']) + if dialog.exec(): + webbrowser.open(data['html_url']) + logging.info('User wants to upgrade; exiting') + sys.exit(0) except Exception as error: # pylint: disable=broad-except logging.error(error)