From 31d0fe1497f780be50451f05759c5f02e175ae7b 2012-07-05 10:56:09 From: Matthias BUSSONNIER Date: 2012-07-05 10:56:09 Subject: [PATCH] convert backtick to repr --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index e175fc4..e3081b9 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -455,7 +455,7 @@ class Pdb(OldPdb): else: first = max(1, int(x) - 5) except: - print '*** Error in argument:', `arg` + print '*** Error in argument:', repr(arg) return elif self.lineno is None: first = max(1, self.curframe.f_lineno - 5) diff --git a/IPython/core/displayhook.py b/IPython/core/displayhook.py index 5eebb5f..36a3a7c 100644 --- a/IPython/core/displayhook.py +++ b/IPython/core/displayhook.py @@ -188,7 +188,7 @@ class DisplayHook(Configurable): if result is not self.shell.user_ns['_oh']: if len(self.shell.user_ns['_oh']) >= self.cache_size and self.do_full_cache: warn('Output cache limit (currently '+ - `self.cache_size`+' entries) hit.\n' + repr(self.cache_size)+' entries) hit.\n' 'Flushing cache and resetting history counter...\n' 'The only history variables available will be _,__,___ and _1\n' 'with the current result.') @@ -208,7 +208,7 @@ class DisplayHook(Configurable): # hackish access to top-level namespace to create _1,_2... dynamically to_main = {} if self.do_full_cache: - new_result = '_'+`self.prompt_count` + new_result = '_'+repr(self.prompt_count) to_main[new_result] = result self.shell.push(to_main, interactive=False) self.shell.user_ns['_oh'][self.prompt_count] = result @@ -248,7 +248,7 @@ class DisplayHook(Configurable): # delete auto-generated vars from global namespace for n in range(1,self.prompt_count + 1): - key = '_'+`n` + key = '_'+repr(n) try: del self.shell.user_ns[key] except: pass diff --git a/IPython/core/logger.py b/IPython/core/logger.py index 56bc4d2..63fd765 100644 --- a/IPython/core/logger.py +++ b/IPython/core/logger.py @@ -117,7 +117,7 @@ class Logger(object): for f in old: root, ext = os.path.splitext(f) num = int(ext[1:-1])+1 - os.rename(f, root+'.'+`num`.zfill(3)+'~') + os.rename(f, root+'.'+repr(num).zfill(3)+'~') os.rename(self.logfname, self.logfname+'.001~') self.logfile = io.open(self.logfname, 'w', encoding='utf-8') diff --git a/IPython/core/magics/execution.py b/IPython/core/magics/execution.py index e111873..d89f17f 100644 --- a/IPython/core/magics/execution.py +++ b/IPython/core/magics/execution.py @@ -254,14 +254,14 @@ python-profiler package from non-free.""") dump_file = unquote_filename(dump_file) prof.dump_stats(dump_file) print '\n*** Profile stats marshalled to file',\ - `dump_file`+'.',sys_exit + repr(dump_file)+'.',sys_exit if text_file: text_file = unquote_filename(text_file) pfile = open(text_file,'w') pfile.write(output) pfile.close() print '\n*** Profile printout saved to text file',\ - `text_file`+'.',sys_exit + repr(text_file)+'.',sys_exit if opts.has_key('r'): return stats diff --git a/IPython/core/page.py b/IPython/core/page.py index 77b226b..b092e40 100644 --- a/IPython/core/page.py +++ b/IPython/core/page.py @@ -250,7 +250,7 @@ def page_file(fname, start=0, pager_cmd=None): start -= 1 page(open(fname).read(),start) except: - print 'Unable to show file',`fname` + print 'Unable to show file',repr(fname) def get_pager_cmd(pager_cmd=None):