From 3e589c454a4722cee3b33fad501f8eef96cd792a Mon Sep 17 00:00:00 2001 From: j Date: Wed, 14 Jun 2017 13:00:44 +0200 Subject: [PATCH] folder might not exist --- ox/file.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ox/file.py b/ox/file.py index a0864fa..ab789a3 100644 --- a/ox/file.py +++ b/ox/file.py @@ -390,6 +390,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