Added a few changes to improve the situation where Py2/3 compatibility packages are installed. 6_1_x

Sun, 08 May 2016 11:45:55 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 08 May 2016 11:45:55 +0200
branch
6_1_x
changeset 4972
fe8015457551
parent 4969
2e3bf59087ec
child 4973
3ac45be22bc7

Added a few changes to improve the situation where Py2/3 compatibility packages are installed.

UI/Previewers/PreviewerHTML.py file | annotate | diff | comparison | revisions
UI/SymbolsWidget.py file | annotate | diff | comparison | revisions
eric6.py file | annotate | diff | comparison | revisions
diff -r 2e3bf59087ec -r fe8015457551 UI/Previewers/PreviewerHTML.py
--- a/UI/Previewers/PreviewerHTML.py	Fri May 06 16:35:40 2016 +0200
+++ b/UI/Previewers/PreviewerHTML.py	Sun May 08 11:45:55 2016 +0200
@@ -10,8 +10,9 @@
 from __future__ import unicode_literals
 
 try:  # Only for Py2
+    basestring
     import StringIO as io   # __IGNORE_EXCEPTION__
-except ImportError:
+except (ImportError, NameError):
     import io       # __IGNORE_WARNING__
 
 import os
diff -r 2e3bf59087ec -r fe8015457551 UI/SymbolsWidget.py
--- a/UI/SymbolsWidget.py	Fri May 06 16:35:40 2016 +0200
+++ b/UI/SymbolsWidget.py	Sun May 08 11:45:55 2016 +0200
@@ -14,7 +14,7 @@
     str = unicode                               # __IGNORE_WARNING__
     chr = unichr                                # __IGNORE_WARNING__
     import htmlentitydefs as html_entities      # __IGNORE_WARNING__
-except NameError:
+except (NameError, ImportError):
     # Py3
     import html.entities as html_entities
 
diff -r 2e3bf59087ec -r fe8015457551 eric6.py
--- a/eric6.py	Fri May 06 16:35:40 2016 +0200
+++ b/eric6.py	Sun May 08 11:45:55 2016 +0200
@@ -24,8 +24,8 @@
 import Toolbox.PyQt4ImportHook  # __IGNORE_WARNING__
 
 try:  # Only for Py2
+    import Globals.compatibility_fixes     # __IGNORE_WARNING__
     import StringIO as io   # __IGNORE_EXCEPTION__
-    import Globals.compatibility_fixes     # __IGNORE_WARNING__
     import locale
     coverage = 'Python'
 except ImportError:

eric ide

mercurial