Skip to content

Commit a2d5c43

Browse files
committed
Restore protection of distutils.log patching.
1 parent 177a893 commit a2d5c43

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

setuptools/logging.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ def configure():
2424
format="{message}", style='{', handlers=handlers, level=logging.DEBUG)
2525
if hasattr(distutils.log, 'Log'):
2626
monkey.patch_func(set_threshold, distutils.log, 'set_threshold')
27+
# For some reason `distutils.log` module is getting cached in `distutils.dist`
28+
# and then loaded again when patched,
29+
# implying: id(distutils.log) != id(distutils.dist.log).
30+
# Make sure the same module object is used everywhere:
31+
distutils.dist.log = distutils.log
2732

2833

2934
def set_threshold(level):

0 commit comments

Comments
 (0)