mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-22 09:18:18 +00:00
PICARD-2869: Run register_excepthook early
Don't separately catch exceptions around main but rely on the new excepthook. This prevents the crash dialog to be shown twice for exceptions which are catched by the exception handler already.
This commit is contained in:
@@ -73,7 +73,6 @@ from picard import (
|
||||
PICARD_ORG_NAME,
|
||||
acoustid,
|
||||
log,
|
||||
register_excepthook,
|
||||
)
|
||||
from picard.acoustid.manager import AcoustIDManager
|
||||
from picard.album import (
|
||||
@@ -1508,8 +1507,6 @@ If a new instance will not be spawned files/directories will be passed to the ex
|
||||
|
||||
|
||||
def main(localedir=None, autoupdate=True):
|
||||
register_excepthook()
|
||||
|
||||
# Some libs (ie. Phonon) require those to be set
|
||||
QtWidgets.QApplication.setApplicationName(PICARD_APP_NAME)
|
||||
QtWidgets.QApplication.setOrganizationName(PICARD_ORG_NAME)
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
try:
|
||||
from picard import register_excepthook
|
||||
register_excepthook()
|
||||
|
||||
from picard.tagger import main
|
||||
main('%(localedir)s', %(autoupdate)s)
|
||||
except SystemExit:
|
||||
raise # Just continue with a normal application exit
|
||||
except: # noqa: E722,F722 # pylint: disable=bare-except
|
||||
from picard import crash_handler
|
||||
crash_handler()
|
||||
raise
|
||||
|
||||
10
tagger.py.in
10
tagger.py.in
@@ -12,12 +12,8 @@ if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
||||
else:
|
||||
basedir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
try:
|
||||
from picard import register_excepthook
|
||||
register_excepthook()
|
||||
|
||||
from picard.tagger import main
|
||||
main(os.path.join(basedir, 'locale'), %(autoupdate)s)
|
||||
except SystemExit:
|
||||
raise # Just continue with a normal application exit
|
||||
except: # noqa: E722,F722 # pylint: disable=bare-except
|
||||
from picard import crash_handler
|
||||
crash_handler()
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user