eric5.py

branch
5_5_x
changeset 3710
0060733678b0
parent 3628
deb5973080a9
child 3813
31b15072115d
--- a/eric5.py	Sat Jul 19 13:56:43 2014 +0200
+++ b/eric5.py	Sat Jul 19 15:39:38 2014 +0200
@@ -37,8 +37,22 @@
 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:    # Py2 
+        import tkMessageBox as messagebox
+    except ImportError:
+        try:    # Py3
+            from tkinter import messagebox
+        except ImportError:
+            sys.exit(100)
+    messagebox.showerror(
+        "eric5 Error",
+        "PyQt4 could not be imported. Please make sure"
+        " it is installed and accessible.")
+    sys.exit(100)
 
 # some global variables needed to start the application
 args = None

eric ide

mercurial