folder might not exist

This commit is contained in:
j 2017-06-14 12:49:23 +02:00
parent 9a6b212ec4
commit aae3407860
1 changed files with 4 additions and 1 deletions

View File

@ -448,6 +448,9 @@ def iexists(path):
folder = '.'
else:
folder = os.path.dirname(path)
files = os.listdir(folder)
try:
files = os.listdir(folder)
except FileNotFoundError:
return False
files = {os.path.basename(f).lower() for f in files}
return name in files