summaryrefslogtreecommitdiff
path: root/Lib/logging
diff options
context:
space:
mode:
authorPreston Landers <planders@utexas.edu>2017-08-02 15:44:28 -0500
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2017-08-02 21:44:28 +0100
commit6ea56d2ebcae69257f8dd7af28c357b25bf394c3 (patch)
tree7e4c607a686f94143ef8ceba102df888e35480ea /Lib/logging
parentde34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2 (diff)
downloadcpython-git-6ea56d2ebcae69257f8dd7af28c357b25bf394c3.tar.gz
bpo-31080: Allowed logging.config.fileConfig() to accept both args and kwargs. (GH-2979)
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index d692514adf..b3f4e28796 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)