diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2008-07-18 08:59:06 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2008-07-18 08:59:06 (GMT) |
commit | bc7e34f692f098cebea089f80704d0ea98c297df (patch) | |
tree | 6286010534f36bdf03cfdbb8a06197d29a8bafac /Lib/logging | |
parent | 0bd10fd5ccf3e670ddb58c615e29155b9b16745d (diff) | |
download | cpython-bc7e34f692f098cebea089f80704d0ea98c297df.zip cpython-bc7e34f692f098cebea089f80704d0ea98c297df.tar.gz cpython-bc7e34f692f098cebea089f80704d0ea98c297df.tar.bz2 |
Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/config.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 50bacdb..6d3daa2 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -146,7 +146,10 @@ def _install_handlers(cp, formatters): fmt = cp.get(sectname, "formatter") else: fmt = "" - klass = eval(klass, vars(logging)) + try: + klass = eval(klass, vars(logging)) + except (AttributeError, NameError): + klass = _resolve(klass) args = cp.get(sectname, "args") args = eval(args, vars(logging)) h = apply(klass, args) |