eric6/Globals/__init__.py

branch
without_py2_and_pyqt4
changeset 7192
a22eee00b052
parent 7085
328f0f44aa95
child 7196
ab0a91b82b37
diff -r 960850ec284c -r a22eee00b052 eric6/Globals/__init__.py
--- a/eric6/Globals/__init__.py	Sat Aug 31 12:29:57 2019 +0200
+++ b/eric6/Globals/__init__.py	Sat Aug 31 12:58:11 2019 +0200
@@ -12,10 +12,6 @@
 #
 
 from __future__ import unicode_literals
-try:
-    str = unicode       # __IGNORE_EXCEPTION__
-except NameError:
-    pass
 
 import sys
 import os
@@ -425,12 +421,8 @@
     @return converted QByteArray
     @rtype QByteArray
     """
-    if sys.version_info[0] == 2:
-        if isinstance(txt, unicode):    # __IGNORE_WARNING__
-            txt = txt.encode("utf-8")
-    else:
-        if isinstance(txt, str):
-            txt = txt.encode("utf-8")
+    if isinstance(txt, str):
+        txt = txt.encode("utf-8")
     
     return QByteArray(txt)
 

eric ide

mercurial