Exit when the config file isn't found.

fix #469
This commit is contained in:
benoitc 2013-04-21 07:40:06 +02:00
parent 1e5948e1c8
commit c31e0f9ac7
2 changed files with 4 additions and 3 deletions

View File

@ -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__",

View File

@ -84,8 +84,6 @@ class Config(object):
for k in keys:
self.settings[k].add_option(parser)
return parser
@property