##// END OF EJS Templates
remove the function unicode_to_str as in python3 it has become redundant
Srinivas Reddy Thatiparthy -
Show More
@@ -2202,14 +2202,12 b' class InteractiveShell(SingletonConfigurable):'
2202 with AvoidUNCPath() as path:
2202 with AvoidUNCPath() as path:
2203 if path is not None:
2203 if path is not None:
2204 cmd = '"pushd %s &&"%s' % (path, cmd)
2204 cmd = '"pushd %s &&"%s' % (path, cmd)
2205 cmd = py3compat.unicode_to_str(cmd)
2206 try:
2205 try:
2207 ec = os.system(cmd)
2206 ec = os.system(cmd)
2208 except KeyboardInterrupt:
2207 except KeyboardInterrupt:
2209 print('\n' + self.get_exception_only(), file=sys.stderr)
2208 print('\n' + self.get_exception_only(), file=sys.stderr)
2210 ec = -2
2209 ec = -2
2211 else:
2210 else:
2212 cmd = py3compat.unicode_to_str(cmd)
2213 # For posix the result of the subprocess.call() below is an exit
2211 # For posix the result of the subprocess.call() below is an exit
2214 # code, which by convention is zero for success, positive for
2212 # code, which by convention is zero for success, positive for
2215 # program failure. Exit codes above 128 are reserved for signals,
2213 # program failure. Exit codes above 128 are reserved for signals,
@@ -37,7 +37,7 b' class Macro(object):'
37 self.value = code + '\n'
37 self.value = code + '\n'
38
38
39 def __str__(self):
39 def __str__(self):
40 return py3compat.unicode_to_str(self.value)
40 return self.value
41
41
42 def __unicode__(self):
42 def __unicode__(self):
43 return self.value
43 return self.value
@@ -42,7 +42,7 b' def test_unicode_ipdir():'
42
42
43 old_ipdir1 = os.environ.pop("IPYTHONDIR", None)
43 old_ipdir1 = os.environ.pop("IPYTHONDIR", None)
44 old_ipdir2 = os.environ.pop("IPYTHON_DIR", None)
44 old_ipdir2 = os.environ.pop("IPYTHON_DIR", None)
45 os.environ["IPYTHONDIR"] = py3compat.unicode_to_str(ipdir, "utf-8")
45 os.environ["IPYTHONDIR"] = ipdir
46 try:
46 try:
47 app = BaseIPythonApplication()
47 app = BaseIPythonApplication()
48 # The lines below are copied from Application.initialize()
48 # The lines below are copied from Application.initialize()
@@ -87,7 +87,7 b" def unquote_filename(name, win32=(sys.platform=='win32')):"
87 def compress_user(path):
87 def compress_user(path):
88 """Reverse of :func:`os.path.expanduser`
88 """Reverse of :func:`os.path.expanduser`
89 """
89 """
90 path = py3compat.unicode_to_str(path, sys.getfilesystemencoding())
90 path = str(path)
91 home = os.path.expanduser('~')
91 home = os.path.expanduser('~')
92 if path.startswith(home):
92 if path.startswith(home):
93 path = "~" + path[len(home):]
93 path = "~" + path[len(home):]
General Comments 0
You need to be logged in to leave comments. Login now