File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1001,9 +1001,7 @@ def open_in_external_editor(self, filename):
10011001 editor_args = shlex .split (prepare_for_exec (self .config .editor ,
10021002 encoding ))
10031003 args = editor_args + [prepare_for_exec (filename , encoding )]
1004- if subprocess .call (args ) == 0 :
1005- return True
1006- return False
1004+ return subprocess .call (args ) == 0 :
10071005
10081006 def edit_config (self ):
10091007 if not (os .path .isfile (self .config .config_path )):
@@ -1028,11 +1026,12 @@ def edit_config(self):
10281026 else :
10291027 return False
10301028
1031- if self .open_in_external_editor (self .config .config_path ):
1032- self .interact .notify (_ ('bpython config file edited. Restart '
1033- 'bpython for changes to take effect.' ))
1034- else :
1035- self .interact .notify (_ ('Error editing config file.' ))
1029+ try :
1030+ if self .open_in_external_editor (self .config .config_path ):
1031+ self .interact .notify (_ ('bpython config file edited. Restart '
1032+ 'bpython for changes to take effect.' ))
1033+ except OSError as e :
1034+ self .interact .notify (_ ('Error editing config file: %s' ) % e )
10361035
10371036
10381037def next_indentation (line , tab_length ):
You can’t perform that action at this time.
0 commit comments