From bc7e34f692f098cebea089f80704d0ea98c297df Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Fri, 18 Jul 2008 08:59:06 +0000 Subject: [PATCH] Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. --- Lib/logging/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 50bacdb3e48..6d3daa26937 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)