From 27bf210adf88d8bbccd539415122934d6b1e0bf3 2016-12-24 17:59:18 From: Srinivas Reddy Thatiparthy Date: 2016-12-24 17:59:18 Subject: [PATCH] Convert str_to_unicode to str function call. --- diff --git a/IPython/core/logger.py b/IPython/core/logger.py index 091da50..933d1a0 100644 --- a/IPython/core/logger.py +++ b/IPython/core/logger.py @@ -18,7 +18,6 @@ import io import os import time -from IPython.utils.py3compat import str_to_unicode #**************************************************************************** # FIXME: This class isn't a mixin anymore, but it still needs attributes from @@ -193,8 +192,8 @@ which already exists. But you must first start the logging process with write = self.logfile.write if kind=='input': if self.timestamp: - write(str_to_unicode(time.strftime('# %a, %d %b %Y %H:%M:%S\n', - time.localtime()))) + write(str(time.strftime('# %a, %d %b %Y %H:%M:%S\n', + time.localtime()))) write(data) elif kind=='output' and self.log_output: odata = u'\n'.join([u'#[Out]# %s' % s diff --git a/IPython/core/magics/logging.py b/IPython/core/magics/logging.py index 90214ab..5ef6a52 100644 --- a/IPython/core/magics/logging.py +++ b/IPython/core/magics/logging.py @@ -19,7 +19,6 @@ import sys # Our own packages from IPython.core.magic import Magics, magics_class, line_magic from warnings import warn -from IPython.utils.py3compat import str_to_unicode #----------------------------------------------------------------------------- # Magic implementation classes @@ -138,7 +137,7 @@ class LoggingMagics(Magics): for n in range(1,len(input_hist)-1): log_write(input_hist[n].rstrip() + u'\n') if n in output_hist: - log_write(str_to_unicode(repr(output_hist[n])),'output') + log_write(str(repr(output_hist[n])),'output') else: logger.log_write(u'\n'.join(input_hist[1:])) logger.log_write(u'\n') diff --git a/IPython/core/tests/test_profile.py b/IPython/core/tests/test_profile.py index 79e3d4b..72b4faf 100644 --- a/IPython/core/tests/test_profile.py +++ b/IPython/core/tests/test_profile.py @@ -121,7 +121,7 @@ def test_list_profiles_in(): # No need to remove these directories and files, as they will get nuked in # the module-level teardown. td = tempfile.mkdtemp(dir=TMP_TEST_DIR) - td = py3compat.str_to_unicode(td) + td = str(td) for name in ('profile_foo', 'profile_hello', 'not_a_profile'): os.mkdir(os.path.join(td, name)) if dec.unicode_paths: @@ -161,4 +161,4 @@ def test_profile_create_ipython_dir(): assert os.path.exists(profile_dir) ipython_config = os.path.join(profile_dir, 'ipython_config.py') assert os.path.exists(ipython_config) - \ No newline at end of file + diff --git a/IPython/terminal/magics.py b/IPython/terminal/magics.py index 5be9234..f17f567 100644 --- a/IPython/terminal/magics.py +++ b/IPython/terminal/magics.py @@ -26,7 +26,7 @@ def get_pasted_lines(sentinel, l_input=py3compat.input, quiet=False): prompt = "" while True: try: - l = py3compat.str_to_unicode(l_input(prompt)) + l = str(l_input(prompt)) if l == sentinel: return else: