Refactor cmd path check using startswith() (#3117)
This commit is contained in:
parent
b7a5d00676
commit
d5bbda1e2f
|
|
@ -115,9 +115,8 @@ class SysCommandWorker:
|
|||
if isinstance(cmd, str):
|
||||
cmd = shlex.split(cmd)
|
||||
|
||||
if cmd:
|
||||
if cmd[0][0] != '/' and cmd[0][:2] != './': # Path() does not work well
|
||||
cmd[0] = locate_binary(cmd[0])
|
||||
if cmd and not cmd[0].startswith(('/', './')): # Path() does not work well
|
||||
cmd[0] = locate_binary(cmd[0])
|
||||
|
||||
self.cmd = cmd
|
||||
self.callbacks = callbacks or {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue