Skip to content

Commit 22610a7

Browse files
committed
Refactored process of determining nonexistant DB's (#5)
1 parent e48ddb1 commit 22610a7

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

searchsploit.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,8 @@ def scrapeRC():
6969

7070
# This section is to remove database paths that do not exist
7171
larray = len(files_array)
72-
for i in range(larray - 1, 0, -1):
73-
try:
74-
tempRead = open(os.path.abspath(os.path.join(path_array[i], files_array[i])),
75-
"r", encoding="utf8")
76-
tempRead.read()
77-
tempRead.close()
78-
except:
79-
try:
80-
tempRead.close()
81-
except:
82-
pass
72+
for i in range(larray - 1, -1, -1):
73+
if not os.path.exists(os.path.abspath(os.path.join(path_array[i], files_array[i]))):
8374
files_array.pop(i)
8475
name_array.pop(i)
8576
path_array.pop(i)

0 commit comments

Comments
 (0)