X-Git-Url: https://git.distorted.org.uk/~mdw/chopwood/blobdiff_plain/a2916c0635fec5b45ad742904db9f5769b48f53d..HEAD:/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: