eric6/Utilities/__init__.py

branch
without_py2_and_pyqt4
changeset 7192
a22eee00b052
parent 7186
ccd55666e9d2
child 7196
ab0a91b82b37
diff -r 960850ec284c -r a22eee00b052 eric6/Utilities/__init__.py
--- a/eric6/Utilities/__init__.py	Sat Aug 31 12:29:57 2019 +0200
+++ b/eric6/Utilities/__init__.py	Sat Aug 31 12:58:11 2019 +0200
@@ -8,22 +8,6 @@
 """
 
 from __future__ import unicode_literals
-try:
-    str = unicode
-    import locale
-    import urllib
-
-    def quote(url):
-        """
-        Replacement for the urllib.quote function because of unicode problems.
-        
-        @param url text to quote (string)
-        @return quoted url (string)
-        """
-        return urllib.quote(url.encode('utf-8'))
-except NameError:
-    basestring = str
-    from urllib.parse import quote    # __IGNORE_WARNING__
 
 import os
 import sys
@@ -623,7 +607,7 @@
     @return dictionary of string, boolean, complex, float and int
     """
     flags = {}
-    if isinstance(text, basestring):
+    if isinstance(text, str):
         lines = text.rstrip().splitlines()
     else:
         lines = text
@@ -1530,9 +1514,6 @@
     if isWindowsPlatform():
         if not user:
             return win32_GetUserName()
-        else:
-            if sys.version_info[0] == 2:
-                user = user.decode(locale.getpreferredencoding())
     
     return user
 
@@ -1653,7 +1634,7 @@
         elif ext in py3Ext and ext not in py2Ext:
             pyVer = 3
         elif source:
-            if isinstance(source, basestring):
+            if isinstance(source, str):
                 line0 = source.splitlines()[0]
             else:
                 line0 = source[0]

eric ide

mercurial