Skip to content

Commit

Permalink
replace exists() with isfile() and isdir()
Browse files Browse the repository at this point in the history
  • Loading branch information
eulertour committed Dec 11, 2018
1 parent 4904780 commit b2f8c75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions constants.py
Expand Up @@ -4,7 +4,7 @@
env_MEDIA_DIR = os.getenv("MEDIA_DIR")
if env_MEDIA_DIR:
MEDIA_DIR = env_MEDIA_DIR
elif os.path.exists("media_dir.txt"):
elif os.path.isfile("media_dir.txt"):
with open("media_dir.txt", 'rU') as media_file:
MEDIA_DIR = media_file.readline().strip()
else:
Expand All @@ -13,7 +13,7 @@
"Dropbox (3Blue1Brown)/3Blue1Brown Team Folder"
)

if not os.path.exists(MEDIA_DIR):
if not os.path.isdir(MEDIA_DIR):
MEDIA_DIR = "media"
print(
f"Media will be stored in {MEDIA_DIR + os.sep}. You can change " + \
Expand Down

0 comments on commit b2f8c75

Please sign in to comment.