folder might not exist
This commit is contained in:
parent
e30ae03f5f
commit
3e589c454a
1 changed files with 4 additions and 1 deletions
|
@ -390,6 +390,9 @@ def iexists(path):
|
||||||
folder = '.'
|
folder = '.'
|
||||||
else:
|
else:
|
||||||
folder = os.path.dirname(path)
|
folder = os.path.dirname(path)
|
||||||
|
try:
|
||||||
files = os.listdir(folder)
|
files = os.listdir(folder)
|
||||||
|
except FileNotFoundError:
|
||||||
|
return False
|
||||||
files = {os.path.basename(f).lower() for f in files}
|
files = {os.path.basename(f).lower() for f in files}
|
||||||
return name in files
|
return name in files
|
||||||
|
|
Loading…
Reference in a new issue