Added an error message for the case, where the initial import of PyQt4 fails. 5_4_x

Sat, 19 Jul 2014 15:41:46 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 19 Jul 2014 15:41:46 +0200
branch
5_4_x
changeset 3711
a48ba9505621
parent 3707
ea1db3ec60b3
child 3713
cebe99c3ca18

Added an error message for the case, where the initial import of PyQt4 fails.

eric5.py file | annotate | diff | comparison | revisions
--- a/eric5.py	Sat Jul 19 13:56:43 2014 +0200
+++ b/eric5.py	Sat Jul 19 15:41:46 2014 +0200
@@ -18,8 +18,19 @@
 import time
 import logging
 
-from PyQt4.QtCore import qWarning, QLibraryInfo, QTimer
-from PyQt4.QtGui import QApplication
+try:
+    from PyQt4.QtCore import qWarning, QLibraryInfo, QTimer
+    from PyQt4.QtGui import QApplication
+except ImportError:
+    try:
+        from tkinter import messagebox
+        messagebox.showerror(
+            "eric5 Error",
+            "PyQt4 could not be imported. Please make sure"
+            " it is installed and accessible.")
+    except ImportError:
+        pass
+    sys.exit(100)
 
 # some global variables needed to start the application
 args = None

eric ide

mercurial