diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2020-01-01 19:32:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-01 19:32:11 (GMT) |
commit | 46abfc1416ff8e450999611ef8f231ff871ab133 (patch) | |
tree | 9e5ed3f91d0aa64434d1c05067b70648e0147fa2 /Lib/logging | |
parent | 22424c02e51fab3b62cbe255d0b87d1b55b9a6c3 (diff) | |
download | cpython-46abfc1416ff8e450999611ef8f231ff871ab133.zip cpython-46abfc1416ff8e450999611ef8f231ff871ab133.tar.gz cpython-46abfc1416ff8e450999611ef8f231ff871ab133.tar.bz2 |
bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773)
This uses the heuristic of assuming a named tuple is a subclass of
tuple with a _fields attribute. This change means that contents of
a named tuple wouldn't be converted - if a user wants to have
ConvertingTuple functionality from a namedtuple, they will have to
implement it themselves.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/config.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 4a3b896..fd3aded 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -448,7 +448,7 @@ class BaseConfigurator(object): value = ConvertingList(value) value.configurator = self elif not isinstance(value, ConvertingTuple) and\ - isinstance(value, tuple): + isinstance(value, tuple) and not hasattr(value, '_fields'): value = ConvertingTuple(value) value.configurator = self elif isinstance(value, str): # str for py3k |