diff options
author | Preston Landers <planders@utexas.edu> | 2017-08-02 20:44:28 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-08-02 20:44:28 (GMT) |
commit | 6ea56d2ebcae69257f8dd7af28c357b25bf394c3 (patch) | |
tree | 7e4c607a686f94143ef8ceba102df888e35480ea /Lib/logging/config.py | |
parent | de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2 (diff) | |
download | cpython-6ea56d2ebcae69257f8dd7af28c357b25bf394c3.zip cpython-6ea56d2ebcae69257f8dd7af28c357b25bf394c3.tar.gz cpython-6ea56d2ebcae69257f8dd7af28c357b25bf394c3.tar.bz2 |
bpo-31080: Allowed logging.config.fileConfig() to accept both args and kwargs. (GH-2979)
Diffstat (limited to 'Lib/logging/config.py')
-rw-r--r-- | Lib/logging/config.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index d692514..b3f4e28 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -143,9 +143,11 @@ def _install_handlers(cp, formatters): klass = eval(klass, vars(logging)) except (AttributeError, NameError): klass = _resolve(klass) - args = section["args"] + args = section.get("args", '()') args = eval(args, vars(logging)) - h = klass(*args) + kwargs = section.get("kwargs", '{}') + kwargs = eval(kwargs, vars(logging)) + h = klass(*args, **kwargs) if "level" in section: level = section["level"] h.setLevel(level) |