##// END OF EJS Templates
Backport PR #2816: in %edit, don't save "last_call" unless last call succeeded...
MinRK -
Show More
@@ -221,15 +221,6 b' class CodeMagics(Magics):'
221 if not shell.user_ns.has_key(args):
221 if not shell.user_ns.has_key(args):
222 args = last_call[1]
222 args = last_call[1]
223
223
224 # use last_call to remember the state of the previous call, but don't
225 # let it be clobbered by successive '-p' calls.
226 try:
227 last_call[0] = shell.displayhook.prompt_count
228 if not opts_prev:
229 last_call[1] = args
230 except:
231 pass
232
233 # by default this is done with temp files, except when the given
224 # by default this is done with temp files, except when the given
234 # arg is a filename
225 # arg is a filename
235 use_temp = True
226 use_temp = True
@@ -310,6 +301,16 b' class CodeMagics(Magics):'
310 filename = shell.mktempfile(data)
301 filename = shell.mktempfile(data)
311 print 'IPython will make a temporary file named:',filename
302 print 'IPython will make a temporary file named:',filename
312
303
304 # use last_call to remember the state of the previous call, but don't
305 # let it be clobbered by successive '-p' calls.
306 try:
307 last_call[0] = shell.displayhook.prompt_count
308 if not opts_prev:
309 last_call[1] = args
310 except:
311 pass
312
313
313 return filename, lineno, use_temp
314 return filename, lineno, use_temp
314
315
315 def _edit_macro(self,mname,macro):
316 def _edit_macro(self,mname,macro):
General Comments 0
You need to be logged in to leave comments. Login now