From 651344027ca375c2a5fa152ef5d6526c0688e4ca Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 Mar 2019 20:18:06 +0530 Subject: [PATCH] Nicer error message if the progress_indicator plugin fails to load --- src/calibre/gui2/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index a6ea48b34d..1705f6c8ed 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -823,7 +823,9 @@ class Application(QApplication): args.extend(['-platformpluginpath', sys.extensions_location, '-platform', 'headless']) self.headless = headless 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: # On OS X high dpi scaling is turned on automatically by the OS, so we dont need to set it explicitly setup_hidpi()