use more specific isfile check
authorJustin Findlay <redacted>
Thu, 15 Sep 2016 18:56:57 +0000 (12:56 -0600)
committerJustin Findlay <redacted>
Thu, 15 Sep 2016 18:56:57 +0000 (12:56 -0600)
xkcdpass/xkcd_password.py

index 008a35df1b3dd63a63802cb175fbcb21d7f01310..8bd85542584f5a4a4452f960914335b28aa49b08 100755 (executable)
@@ -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
 
 
git clone https://git.99rst.org/PROJECT