Skip to content

Commit

Permalink
read from blacklist.txt only if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jgor committed Aug 31, 2018
1 parent 6efaaed commit 87b4a9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dorkbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ def scan(db, scanner, args):
def get_blacklist(blacklist_file):
pattern = "$^"
try:
with open(blacklist_file, "r") as f:
pattern = "|".join(f.read().splitlines())
if os.path.isfile(blacklist_file):
with open(blacklist_file, "r") as f:
pattern = "|".join(f.read().splitlines())
blacklist = re.compile(pattern)
except Exception as e:
print("ERROR reading blacklist - %s" % e, file=sys.stderr)
Expand Down

0 comments on commit 87b4a9a

Please sign in to comment.