File tree 1 file changed +15
-14
lines changed 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change 59
59
60
60
61
61
def open_file (path : str ):
62
- if sys .platform == "win32" :
63
- command_name = "start"
64
- elif sys .platform == "darwin" :
65
- command_name = "open"
66
- else :
67
- command_name = "xdg-open"
68
- command = shutil .which (command_name )
69
- if command is not None :
70
- try :
71
- subprocess .Popen ([command , path ], close_fds = True )
72
- except :
73
- traceback .print_exc ()
74
- else :
75
- logging .info (f"Could not find { command_name } on system PATH" )
62
+ try :
63
+ if sys .platform == "win32" :
64
+ subprocess .Popen (["start" , path ], shell = True , close_fds = True )
65
+ else :
66
+ if sys .platform == "darwin" :
67
+ command_name = "open"
68
+ else :
69
+ command_name = "xdg-open"
70
+ command = shutil .which (command_name )
71
+ if command is not None :
72
+ subprocess .Popen ([command , path ], close_fds = True )
73
+ else :
74
+ logging .info (f"Could not find { command_name } on system PATH" )
75
+ except :
76
+ traceback .print_exc ()
76
77
77
78
78
79
class NavigationState ():
You can’t perform that action at this time.
0 commit comments