Files
picard/tagger.py.in
Philipp Wolfer c960089b80 PICARD-1718: Moved crash handler code into central function
Avoid code duplication, by still having a rather minimal dependency of internal code.
2021-05-04 16:12:50 +02:00

27 lines
659 B
Python

#!/usr/bin/env python3
import os
import sys
sys.path.insert(0, '.')
# This is needed to find resources when using pyinstaller
if getattr(sys, 'frozen', False):
basedir = getattr(sys, '_MEIPASS', '')
else:
basedir = os.path.dirname(os.path.abspath(__file__))
if sys.platform == 'win32':
os.environ['PATH'] = basedir + ';' + os.environ['PATH']
try:
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