Skip to content

Commit

Permalink
Add ValueError exception and remove useless line.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptoki committed Sep 24, 2017
1 parent 90eabeb commit e6da049
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion passcat/passcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ def main():
if path is None:
path = '%s/wordlists/%s.txt' % (_dir, args.wordlist.lower())
try:
if not path.endswith('.txt'):
raise ValueError("Passcat currently only supports text files.")
with open(path) as f:
words = f.read().splitlines()
f.close()
except ValueError as error:
print("Error:", error)
sys.exit()
except FileNotFoundError:
print("Error: File not found. Please input the path of an existing file "
"or use the '-l' flag to show available wordlists.")
Expand Down

0 comments on commit e6da049

Please sign in to comment.