Skip to content

Commit

Permalink
pythongh-115032: Update DictConfigurator.configure_formatter() commen…
Browse files Browse the repository at this point in the history
…t about `fmt` retry. (pythonGH-115303)
  • Loading branch information
felixxm committed Feb 13, 2024
1 parent 0a6e1a4 commit d823c23
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Lib/logging/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d823c23

Please sign in to comment.