File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -809,13 +809,14 @@ def getstdout(self):
809809 return s
810810 def send_to_external_editor (self , filename = None ):
811811 editor = os .environ .get ('VISUAL' , os .environ .get ('EDITOR' , 'vim' ))
812+ editor_args = editor .split ()
812813 text = self .getstdout ()
813814 with tempfile .NamedTemporaryFile (suffix = '.py' ) as temp :
814815 temp .write ('### current bpython session - file will be reevaluated, ### lines will not be run\n ' .encode ('utf8' ))
815816 temp .write ('\n ' .join (line [4 :] if line [:4 ] in ('... ' , '>>> ' ) else '### ' + line
816817 for line in text .split ('\n ' )).encode ('utf8' ))
817818 temp .flush ()
818- subprocess .call ([ editor , temp .name ])
819+ subprocess .call (editor_args + [ temp .name ])
819820 self .history = [line for line in open (temp .name ).read ().split ('\n ' )
820821 if line [:4 ] != '### ' ]
821822 self .reevaluate (insert_into_history = True )
You can’t perform that action at this time.
0 commit comments