Skip to content

Commit 4c267c7

Browse files
committed
Replace condition to patch distutils.dist.log
As `distutils.log.Log` was backfilled for compatibility we no longer can use this as a condition.
1 parent 7049c73 commit 4c267c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setuptools/logging.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import inspect
23
import logging
34
import distutils.log
45
from . import monkey
@@ -22,7 +23,7 @@ def configure():
2223
handlers = err_handler, out_handler
2324
logging.basicConfig(
2425
format="{message}", style='{', handlers=handlers, level=logging.DEBUG)
25-
if hasattr(distutils.log, 'Log'):
26+
if inspect.ismodule(distutils.dist.log):
2627
monkey.patch_func(set_threshold, distutils.log, 'set_threshold')
2728
# For some reason `distutils.log` module is getting cached in `distutils.dist`
2829
# and then loaded again when patched,

0 commit comments

Comments
 (0)