Skip to content

Commit b085733

Browse files
authored
Merge pull request #524 from vlkumiloslearning/fix/process-exists-false-positive
fix: replace subprocess which with shutil.which() in Process.exists()
2 parents e5fc123 + 077b8e1 commit b085733

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

wifite/util/process.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,7 @@ def exists(program):
200200
if Configuration.initialized and program in Configuration.existing_commands:
201201
return Configuration.existing_commands[program]
202202

203-
p2 = Process(['which', program])
204-
stdout = p2.stdout().strip()
205-
stderr = p2.stderr().strip()
206-
207-
exist = not stdout == stderr == ''
203+
exist = shutil.which(program) is not None
208204
if Configuration.initialized:
209205
Configuration.existing_commands.update({program: exist})
210206
return exist

0 commit comments

Comments
 (0)