Nicer error message if the progress_indicator plugin fails to load

This commit is contained in:
Kovid Goyal 2019-03-17 20:18:06 +05:30
parent dc4c444a71
commit 651344027c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -823,7 +823,9 @@ class Application(QApplication):
args.extend(['-platformpluginpath', sys.extensions_location, '-platform', 'headless']) args.extend(['-platformpluginpath', sys.extensions_location, '-platform', 'headless'])
self.headless = headless self.headless = headless
qargs = [i.encode('utf-8') if isinstance(i, unicode_type) else i for i in args] qargs = [i.encode('utf-8') if isinstance(i, unicode_type) else i for i in args]
self.pi = plugins['progress_indicator'][0] self.pi, pi_err = plugins['progress_indicator']
if pi_err:
raise RuntimeError('Failed to load the progress_indicator C extension, with error: {}'.format(pi_err))
if not isosx and not headless: if not isosx and not headless:
# On OS X high dpi scaling is turned on automatically by the OS, so we dont need to set it explicitly # On OS X high dpi scaling is turned on automatically by the OS, so we dont need to set it explicitly
setup_hidpi() setup_hidpi()