From: Vinay Sajip Date: Fri, 18 Jul 2008 08:59:06 +0000 (+0000) Subject: Issue #3389: Allow resolving dotted names for handlers in logging configuration files... X-Git-Tag: v2.6b3~292 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc7e34f692f098cebea089f80704d0ea98c297df;p=thirdparty%2FPython%2Fcpython.git Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. --- diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 50bacdb3e48b..6d3daa269375 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)