fix: Ensure existence of directory

This commit is contained in:
Sayantan Santra 2025-03-05 23:33:14 -06:00
parent 2aa5a0ff23
commit 58da47c04a
Signed by: SinTan1729
GPG key ID: 0538DD402EA50898

View file

@ -62,10 +62,8 @@ def valid_filename(directory, filename=None):
directory = os.path.dirname(directory)
# Allow for directories.
try:
items = os.listdir(directory)
except:
items = []
ensure_directory_exists(directory)
items = os.listdir(directory)
if filename in items:
count = 1