From c31e0f9ac72b214817d8fd8192896f0af4135eb8 Mon Sep 17 00:00:00 2001 From: benoitc Date: Sun, 21 Apr 2013 07:40:06 +0200 Subject: [PATCH] Exit when the config file isn't found. fix #469 --- gunicorn/app/base.py | 5 ++++- gunicorn/config.py | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gunicorn/app/base.py b/gunicorn/app/base.py index bb7683d2..832abff0 100644 --- a/gunicorn/app/base.py +++ b/gunicorn/app/base.py @@ -53,7 +53,10 @@ class Application(object): self.cfg.set(k.lower(), v) # Load up the config file if its found. - if args.config and os.path.exists(args.config): + if args.config: + if not os.path.exists(args.config): + raise RuntimeError("%r doesn't exist" % args.config) + cfg = { "__builtins__": __builtins__, "__name__": "__config__", diff --git a/gunicorn/config.py b/gunicorn/config.py index a7064370..18630f37 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -84,8 +84,6 @@ class Config(object): for k in keys: self.settings[k].add_option(parser) - - return parser @property