Skip to content

Commit

Permalink
Restore protection of distutils.log patching.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Oct 9, 2022
1 parent 177a893 commit a2d5c43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions setuptools/logging.py
Expand Up @@ -24,6 +24,11 @@ def configure():
format="{message}", style='{', handlers=handlers, level=logging.DEBUG)
if hasattr(distutils.log, 'Log'):
monkey.patch_func(set_threshold, distutils.log, 'set_threshold')
# For some reason `distutils.log` module is getting cached in `distutils.dist`
# and then loaded again when patched,
# implying: id(distutils.log) != id(distutils.dist.log).
# Make sure the same module object is used everywhere:
distutils.dist.log = distutils.log


def set_threshold(level):
Expand Down

0 comments on commit a2d5c43

Please sign in to comment.