Skip to content

Commit

Permalink
Replace condition to patch distutils.dist.log
Browse files Browse the repository at this point in the history
As `distutils.log.Log` was backfilled for compatibility we no longer can
use this as a condition.
  • Loading branch information
abravalheri committed Nov 23, 2022
1 parent 7049c73 commit 4c267c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setuptools/logging.py
@@ -1,4 +1,5 @@
import sys
import inspect
import logging
import distutils.log
from . import monkey
Expand All @@ -22,7 +23,7 @@ def configure():
handlers = err_handler, out_handler
logging.basicConfig(
format="{message}", style='{', handlers=handlers, level=logging.DEBUG)
if hasattr(distutils.log, 'Log'):
if inspect.ismodule(distutils.dist.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,
Expand Down

0 comments on commit 4c267c7

Please sign in to comment.