Made the last change Python2 compatible.

Sat, 19 Jul 2014 15:38:53 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 19 Jul 2014 15:38:53 +0200
changeset 3709
191ccdf78966
parent 3708
4fbb91fb6a31
child 3714
4080395e3426

Made the last change Python2 compatible.

eric6.py file | annotate | diff | comparison | revisions
--- a/eric6.py	Sat Jul 19 15:24:47 2014 +0200
+++ b/eric6.py	Sat Jul 19 15:38:53 2014 +0200
@@ -36,14 +36,17 @@
 try:
     from PyQt5.QtCore import qWarning, QLibraryInfo, QTimer, QCoreApplication
 except ImportError:
-    try:
-        from tkinter import messagebox
-        messagebox.showerror(
-            "eric6 Error",
-            "PyQt5 could not be imported. Please make sure"
-            " it is installed and accessible.")
+    try:    # Py2 
+        import tkMessageBox as messagebox
     except ImportError:
-        pass
+        try:    # Py3
+            from tkinter import messagebox
+        except ImportError:
+            sys.exit(100)
+    messagebox.showerror(
+        "eric6 Error",
+        "PyQt5 could not be imported. Please make sure"
+        " it is installed and accessible.")
     sys.exit(100)
 
 # some global variables needed to start the application

eric ide

mercurial