diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2022-10-08 20:57:44 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-10-08 21:07:12 -0400 |
| commit | a2d5c43368573f0fe0a620c87ef4dd9391d40eda (patch) | |
| tree | cf333ac72761b4d356066ea3f3ce111f1943d1cd /setuptools | |
| parent | 177a89319ee3135b3c4ed0780bd8fc1c3e3d0161 (diff) | |
| download | python-setuptools-git-a2d5c43368573f0fe0a620c87ef4dd9391d40eda.tar.gz | |
Restore protection of distutils.log patching.
Diffstat (limited to 'setuptools')
| -rw-r--r-- | setuptools/logging.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/setuptools/logging.py b/setuptools/logging.py index 70708adb..e99c1b9d 100644 --- a/setuptools/logging.py +++ b/setuptools/logging.py @@ -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): |
