X-Git-Url: https://git.distorted.org.uk/~mdw/chopwood/blobdiff_plain/e3295bed428adbf5e1863f2d9395adac33dbb071..9fc9351d43236aeca3910b977eef0cdf355a085e:/config.py diff --git a/config.py b/config.py index 2c13232..bb7b32b 100644 --- a/config.py +++ b/config.py @@ -26,6 +26,7 @@ from __future__ import with_statement import os as OS; ENV = OS.environ +import output as O; OUT = O.OUT import sys as SYS import types as TY @@ -81,8 +82,12 @@ def loadconfig(config): d.update(DEFAULTS) ## And run the configuration code. - with open(config) as f: - exec f in d + try: + with open(config) as f: + exec f in d + except IOError, e: + OUT.warn("couldn't open configuration file `%s': %s" % + (config, e.strerror)) ## Run the hooks. for func in _HOOKS: