gh-115032: Update DictConfigurator.configure_formatter() comment about fmt retry. (GH-115303)

This commit is contained in:
Mariusz Felisiak 2024-02-13 09:47:40 +01:00 committed by GitHub
parent 0a6e1a4119
commit d823c23549
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -667,10 +667,9 @@ def configure_formatter(self, config):
except TypeError as te:
if "'format'" not in str(te):
raise
#Name of parameter changed from fmt to format.
#Retry with old name.
#This is so that code can be used with older Python versions
#(e.g. by Django)
# logging.Formatter and its subclasses expect the `fmt`
# parameter instead of `format`. Retry passing configuration
# with `fmt`.
config['fmt'] = config.pop('format')
config['()'] = factory
result = self.configure_custom(config)