diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-29 11:31:51 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-29 11:33:08 -0500 |
| commit | d0da0142609318e534d5874bfa0c44d1254f9e38 (patch) | |
| tree | 0b4f964680930f3604735466301e52643eedceaa /_distutils_hack/__init__.py | |
| parent | b324f92d0a9583f07c137d29d4c68f2ae7fc4b68 (diff) | |
| download | python-setuptools-git-d0da0142609318e534d5874bfa0c44d1254f9e38.tar.gz | |
Restore 'add_shim' as the way to invoke the hook. Avoids compatibility issues between different versions of Setuptools with the distutils local implementation. Renamed the former 'add_shim' as 'insert_shim'. Fixes #2983
Diffstat (limited to '_distutils_hack/__init__.py')
| -rw-r--r-- | _distutils_hack/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py index 55ea0825..0a8f0473 100644 --- a/_distutils_hack/__init__.py +++ b/_distutils_hack/__init__.py @@ -136,20 +136,20 @@ class DistutilsMetaFinder: DISTUTILS_FINDER = DistutilsMetaFinder() -def ensure_shim(): - DISTUTILS_FINDER in sys.meta_path or add_shim() +def add_shim(): + DISTUTILS_FINDER in sys.meta_path or insert_shim() @contextlib.contextmanager def shim(): - add_shim() + insert_shim() try: yield finally: remove_shim() -def add_shim(): +def insert_shim(): sys.meta_path.insert(0, DISTUTILS_FINDER) |
