File tree 1 file changed +7
-8
lines changed
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):
1001
1001
editor_args = shlex .split (prepare_for_exec (self .config .editor ,
1002
1002
encoding ))
1003
1003
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 :
1007
1005
1008
1006
def edit_config (self ):
1009
1007
if not (os .path .isfile (self .config .config_path )):
@@ -1028,11 +1026,12 @@ def edit_config(self):
1028
1026
else :
1029
1027
return False
1030
1028
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 )
1036
1035
1037
1036
1038
1037
def next_indentation (line , tab_length ):
You can’t perform that action at this time.
0 commit comments