From e6fbc51ebf1789d86444f90d059666f03a0f3ad6 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 4 Jul 2014 20:55:05 +0200 Subject: [PATCH] Simplify case where datadir is empty --- patacrep/content/include.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/patacrep/content/include.py b/patacrep/content/include.py index b1e1f1cd..5c73d8e2 100644 --- a/patacrep/content/include.py +++ b/patacrep/content/include.py @@ -16,10 +16,7 @@ from patacrep.content import process_content, ContentError LOGGER = logging.getLogger(__name__) def load_from_datadirs(path, config=None): - if not config or not config["datadir"]: - LOGGER.error("No datadir in the configuration.") - sys.exit(1) - for datadir in config["datadir"]: + for datadir in config.get("datadir", []): filepath = os.path.join(datadir, path) if os.path.exists(filepath): return filepath