Skip to content

Commit 64d3ac0

Browse files
author
WhiteOnBlackCode
committed
Don't attempt to access the existing_cammands if the config not initialized yet
1 parent a26e41f commit 64d3ac0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

wifite/util/process.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@ def call(command, cwd=None, shell=False):
5454
def exists(program):
5555
''' Checks if program is installed on this system '''
5656

57-
if program in set(Configuration.existing_commands.keys()):
58-
return Configuration.existing_commands[program]
57+
if Configuration.initialized: # Maybe we already checked this program
58+
if program in set(Configuration.existing_commands.keys()):
59+
return Configuration.existing_commands[program]
5960

6061
p = Process(['which', program])
6162
stdout = p.stdout().strip()
6263
stderr = p.stderr().strip()
6364

6465
exist = not stdout == stderr == ''
65-
Configuration.existing_commands.update({program: exist})
66+
if Configuration.initialized:
67+
Configuration.existing_commands.update({program: exist})
6668
return exist
6769

6870
def __init__(self, command, devnull=False, stdout=PIPE, stderr=PIPE, cwd=None, bufsize=0, stdin=PIPE):

0 commit comments

Comments
 (0)