mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-31080: Allowed logging.config.fileConfig() to accept both args and kwargs. (GH-2979)
This commit is contained in:
parent
de34cbe9cd
commit
6ea56d2ebc
4 changed files with 15 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue