##// END OF EJS Templates
in %edit, don't save "last_call" unless last call succeeded...
MinRK -
Show More
@@ -245,15 +245,6 b' class CodeMagics(Magics):'
245 if args not in shell.user_ns:
245 if args not in shell.user_ns:
246 args = last_call[1]
246 args = last_call[1]
247
247
248 # use last_call to remember the state of the previous call, but don't
249 # let it be clobbered by successive '-p' calls.
250 try:
251 last_call[0] = shell.displayhook.prompt_count
252 if not opts_prev:
253 last_call[1] = args
254 except:
255 pass
256
257 # by default this is done with temp files, except when the given
248 # by default this is done with temp files, except when the given
258 # arg is a filename
249 # arg is a filename
259 use_temp = True
250 use_temp = True
@@ -340,6 +331,16 b' class CodeMagics(Magics):'
340 filename = shell.mktempfile(data)
331 filename = shell.mktempfile(data)
341 print 'IPython will make a temporary file named:',filename
332 print 'IPython will make a temporary file named:',filename
342
333
334 # use last_call to remember the state of the previous call, but don't
335 # let it be clobbered by successive '-p' calls.
336 try:
337 last_call[0] = shell.displayhook.prompt_count
338 if not opts_prev:
339 last_call[1] = args
340 except:
341 pass
342
343
343 return filename, lineno, use_temp
344 return filename, lineno, use_temp
344
345
345 def _edit_macro(self,mname,macro):
346 def _edit_macro(self,mname,macro):
General Comments 0
You need to be logged in to leave comments. Login now