From: Justin Findlay Date: Thu, 15 Sep 2016 18:56:57 +0000 (-0600) Subject: use more specific isfile check X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=34c64c0792873a061826bfdb1179fc3fedca5d32;p=redacted-XKCD-password-generator.git use more specific isfile check --- diff --git a/xkcdpass/xkcd_password.py b/xkcdpass/xkcd_password.py index 008a35d..8bd8554 100755 --- a/xkcdpass/xkcd_password.py +++ b/xkcdpass/xkcd_password.py @@ -69,7 +69,7 @@ def validate_options(parser, options): sys.exit(1) if options.wordfile is not None: - if not os.path.exists(os.path.abspath(options.wordfile)): + if not os.path.isfile(os.path.abspath(options.wordfile)): sys.stderr.write("Could not open the specified word file.\n") sys.exit(1) else: @@ -92,7 +92,7 @@ def locate_wordfile(): "/usr/share/dict/words"] for wfile in common_word_files: - if os.path.exists(wfile): + if os.path.isfile(wfile): return wfile