##// END OF EJS Templates
convert backtick to repr
Matthias BUSSONNIER -
Show More
@@ -455,7 +455,7 b' class Pdb(OldPdb):'
455 else:
455 else:
456 first = max(1, int(x) - 5)
456 first = max(1, int(x) - 5)
457 except:
457 except:
458 print '*** Error in argument:', `arg`
458 print '*** Error in argument:', repr(arg)
459 return
459 return
460 elif self.lineno is None:
460 elif self.lineno is None:
461 first = max(1, self.curframe.f_lineno - 5)
461 first = max(1, self.curframe.f_lineno - 5)
@@ -188,7 +188,7 b' class DisplayHook(Configurable):'
188 if result is not self.shell.user_ns['_oh']:
188 if result is not self.shell.user_ns['_oh']:
189 if len(self.shell.user_ns['_oh']) >= self.cache_size and self.do_full_cache:
189 if len(self.shell.user_ns['_oh']) >= self.cache_size and self.do_full_cache:
190 warn('Output cache limit (currently '+
190 warn('Output cache limit (currently '+
191 `self.cache_size`+' entries) hit.\n'
191 repr(self.cache_size)+' entries) hit.\n'
192 'Flushing cache and resetting history counter...\n'
192 'Flushing cache and resetting history counter...\n'
193 'The only history variables available will be _,__,___ and _1\n'
193 'The only history variables available will be _,__,___ and _1\n'
194 'with the current result.')
194 'with the current result.')
@@ -208,7 +208,7 b' class DisplayHook(Configurable):'
208 # hackish access to top-level namespace to create _1,_2... dynamically
208 # hackish access to top-level namespace to create _1,_2... dynamically
209 to_main = {}
209 to_main = {}
210 if self.do_full_cache:
210 if self.do_full_cache:
211 new_result = '_'+`self.prompt_count`
211 new_result = '_'+repr(self.prompt_count)
212 to_main[new_result] = result
212 to_main[new_result] = result
213 self.shell.push(to_main, interactive=False)
213 self.shell.push(to_main, interactive=False)
214 self.shell.user_ns['_oh'][self.prompt_count] = result
214 self.shell.user_ns['_oh'][self.prompt_count] = result
@@ -248,7 +248,7 b' class DisplayHook(Configurable):'
248 # delete auto-generated vars from global namespace
248 # delete auto-generated vars from global namespace
249
249
250 for n in range(1,self.prompt_count + 1):
250 for n in range(1,self.prompt_count + 1):
251 key = '_'+`n`
251 key = '_'+repr(n)
252 try:
252 try:
253 del self.shell.user_ns[key]
253 del self.shell.user_ns[key]
254 except: pass
254 except: pass
@@ -117,7 +117,7 b' class Logger(object):'
117 for f in old:
117 for f in old:
118 root, ext = os.path.splitext(f)
118 root, ext = os.path.splitext(f)
119 num = int(ext[1:-1])+1
119 num = int(ext[1:-1])+1
120 os.rename(f, root+'.'+`num`.zfill(3)+'~')
120 os.rename(f, root+'.'+repr(num).zfill(3)+'~')
121 os.rename(self.logfname, self.logfname+'.001~')
121 os.rename(self.logfname, self.logfname+'.001~')
122 self.logfile = io.open(self.logfname, 'w', encoding='utf-8')
122 self.logfile = io.open(self.logfname, 'w', encoding='utf-8')
123
123
@@ -254,14 +254,14 b' python-profiler package from non-free.""")'
254 dump_file = unquote_filename(dump_file)
254 dump_file = unquote_filename(dump_file)
255 prof.dump_stats(dump_file)
255 prof.dump_stats(dump_file)
256 print '\n*** Profile stats marshalled to file',\
256 print '\n*** Profile stats marshalled to file',\
257 `dump_file`+'.',sys_exit
257 repr(dump_file)+'.',sys_exit
258 if text_file:
258 if text_file:
259 text_file = unquote_filename(text_file)
259 text_file = unquote_filename(text_file)
260 pfile = open(text_file,'w')
260 pfile = open(text_file,'w')
261 pfile.write(output)
261 pfile.write(output)
262 pfile.close()
262 pfile.close()
263 print '\n*** Profile printout saved to text file',\
263 print '\n*** Profile printout saved to text file',\
264 `text_file`+'.',sys_exit
264 repr(text_file)+'.',sys_exit
265
265
266 if opts.has_key('r'):
266 if opts.has_key('r'):
267 return stats
267 return stats
@@ -250,7 +250,7 b' def page_file(fname, start=0, pager_cmd=None):'
250 start -= 1
250 start -= 1
251 page(open(fname).read(),start)
251 page(open(fname).read(),start)
252 except:
252 except:
253 print 'Unable to show file',`fname`
253 print 'Unable to show file',repr(fname)
254
254
255
255
256 def get_pager_cmd(pager_cmd=None):
256 def get_pager_cmd(pager_cmd=None):
General Comments 0
You need to be logged in to leave comments. Login now