##// END OF EJS Templates
Convert str_to_unicode to str function call.
Srinivas Reddy Thatiparthy -
Show More
@@ -18,7 +18,6 b' import io'
18 import os
18 import os
19 import time
19 import time
20
20
21 from IPython.utils.py3compat import str_to_unicode
22
21
23 #****************************************************************************
22 #****************************************************************************
24 # FIXME: This class isn't a mixin anymore, but it still needs attributes from
23 # FIXME: This class isn't a mixin anymore, but it still needs attributes from
@@ -193,8 +192,8 b' which already exists. But you must first start the logging process with'
193 write = self.logfile.write
192 write = self.logfile.write
194 if kind=='input':
193 if kind=='input':
195 if self.timestamp:
194 if self.timestamp:
196 write(str_to_unicode(time.strftime('# %a, %d %b %Y %H:%M:%S\n',
195 write(str(time.strftime('# %a, %d %b %Y %H:%M:%S\n',
197 time.localtime())))
196 time.localtime())))
198 write(data)
197 write(data)
199 elif kind=='output' and self.log_output:
198 elif kind=='output' and self.log_output:
200 odata = u'\n'.join([u'#[Out]# %s' % s
199 odata = u'\n'.join([u'#[Out]# %s' % s
@@ -19,7 +19,6 b' import sys'
19 # Our own packages
19 # Our own packages
20 from IPython.core.magic import Magics, magics_class, line_magic
20 from IPython.core.magic import Magics, magics_class, line_magic
21 from warnings import warn
21 from warnings import warn
22 from IPython.utils.py3compat import str_to_unicode
23
22
24 #-----------------------------------------------------------------------------
23 #-----------------------------------------------------------------------------
25 # Magic implementation classes
24 # Magic implementation classes
@@ -138,7 +137,7 b' class LoggingMagics(Magics):'
138 for n in range(1,len(input_hist)-1):
137 for n in range(1,len(input_hist)-1):
139 log_write(input_hist[n].rstrip() + u'\n')
138 log_write(input_hist[n].rstrip() + u'\n')
140 if n in output_hist:
139 if n in output_hist:
141 log_write(str_to_unicode(repr(output_hist[n])),'output')
140 log_write(str(repr(output_hist[n])),'output')
142 else:
141 else:
143 logger.log_write(u'\n'.join(input_hist[1:]))
142 logger.log_write(u'\n'.join(input_hist[1:]))
144 logger.log_write(u'\n')
143 logger.log_write(u'\n')
@@ -121,7 +121,7 b' def test_list_profiles_in():'
121 # No need to remove these directories and files, as they will get nuked in
121 # No need to remove these directories and files, as they will get nuked in
122 # the module-level teardown.
122 # the module-level teardown.
123 td = tempfile.mkdtemp(dir=TMP_TEST_DIR)
123 td = tempfile.mkdtemp(dir=TMP_TEST_DIR)
124 td = py3compat.str_to_unicode(td)
124 td = str(td)
125 for name in ('profile_foo', 'profile_hello', 'not_a_profile'):
125 for name in ('profile_foo', 'profile_hello', 'not_a_profile'):
126 os.mkdir(os.path.join(td, name))
126 os.mkdir(os.path.join(td, name))
127 if dec.unicode_paths:
127 if dec.unicode_paths:
@@ -161,4 +161,4 b' def test_profile_create_ipython_dir():'
161 assert os.path.exists(profile_dir)
161 assert os.path.exists(profile_dir)
162 ipython_config = os.path.join(profile_dir, 'ipython_config.py')
162 ipython_config = os.path.join(profile_dir, 'ipython_config.py')
163 assert os.path.exists(ipython_config)
163 assert os.path.exists(ipython_config)
164 No newline at end of file
164
@@ -26,7 +26,7 b' def get_pasted_lines(sentinel, l_input=py3compat.input, quiet=False):'
26 prompt = ""
26 prompt = ""
27 while True:
27 while True:
28 try:
28 try:
29 l = py3compat.str_to_unicode(l_input(prompt))
29 l = str(l_input(prompt))
30 if l == sentinel:
30 if l == sentinel:
31 return
31 return
32 else:
32 else:
General Comments 0
You need to be logged in to leave comments. Login now