diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2022-10-05 19:11:32 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-10-05 19:22:52 -0400 |
commit | 1546d40ae9cc26a3fa998d174984cda3ebbae4dd (patch) | |
tree | a144f662a0e345cdb6e625d49f7e534b674c76bd | |
parent | 2aaa95ef623c44c04eb5de484c78fc586b43abc6 (diff) | |
download | python-setuptools-git-1546d40ae9cc26a3fa998d174984cda3ebbae4dd.tar.gz |
Remove hack around distutils.dist.log, no longer relevant with pypa/distutils#183.
-rw-r--r-- | setuptools/logging.py | 6 | ||||
-rw-r--r-- | setuptools/tests/test_distutils_adoption.py | 21 |
2 files changed, 0 insertions, 27 deletions
diff --git a/setuptools/logging.py b/setuptools/logging.py index 5d41c988..a902e3b9 100644 --- a/setuptools/logging.py +++ b/setuptools/logging.py @@ -24,12 +24,6 @@ def configure(): format="{message}", style='{', handlers=handlers, level=logging.DEBUG) 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): logging.root.setLevel(level*10) diff --git a/setuptools/tests/test_distutils_adoption.py b/setuptools/tests/test_distutils_adoption.py index df8f3541..5669aab8 100644 --- a/setuptools/tests/test_distutils_adoption.py +++ b/setuptools/tests/test_distutils_adoption.py @@ -135,24 +135,3 @@ def test_modules_are_not_duplicated_on_import( cmd = ['python', '-c', script] output = popen_text(venv.run)(cmd, env=win_sr(env)).strip() assert output == "success" - - -ENSURE_LOG_IMPORT_IS_NOT_DUPLICATED = r""" -# Similar to ENSURE_IMPORTS_ARE_NOT_DUPLICATED -import distutils.dist as dist -from distutils import log - -assert dist.log == log, ( - f"\n{dist.log}\n!=\n{log}" -) - -print("success") -""" - - -@pytest.mark.parametrize("distutils_version", "local stdlib".split()) -def test_log_module_is_not_duplicated_on_import(distutils_version, tmpdir_cwd, venv): - env = dict(SETUPTOOLS_USE_DISTUTILS=distutils_version) - cmd = ['python', '-c', ENSURE_LOG_IMPORT_IS_NOT_DUPLICATED] - output = popen_text(venv.run)(cmd, env=win_sr(env)).strip() - assert output == "success" |