diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-04-19 17:18:27 +0100 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-04-19 17:18:27 +0100 |
commit | ac07f21af8ee73e32448bb0429469b56f412a597 (patch) | |
tree | c45e8284ca8668b8aa594deed813145adc1264b8 /setuptools/command | |
parent | 245d72a8aa4d47e1811425213aba2a06a0bb64fa (diff) | |
download | python-setuptools-git-ac07f21af8ee73e32448bb0429469b56f412a597.tar.gz |
Handle Python3.12a7 compatibility problems
Diffstat (limited to 'setuptools/command')
-rw-r--r-- | setuptools/command/easy_install.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 444d3b33..bf6c964e 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -62,6 +62,7 @@ from pkg_resources import ( VersionConflict, DEVELOP_DIST, ) import pkg_resources +from .. import _py312compat from .._path import ensure_directory from ..extern.jaraco.text import yield_lines @@ -202,7 +203,7 @@ class easy_install(Command): return is_tree = os.path.isdir(path) and not os.path.islink(path) - remover = rmtree if is_tree else os.unlink + remover = _rmtree if is_tree else os.unlink remover(path) @staticmethod @@ -645,7 +646,7 @@ class easy_install(Command): # cast to str as workaround for #709 and #710 and #712 yield str(tmpdir) finally: - os.path.exists(tmpdir) and rmtree(tmpdir) + os.path.exists(tmpdir) and _rmtree(tmpdir) def easy_install(self, spec, deps=False): with self._tmpdir() as tmpdir: @@ -1182,7 +1183,7 @@ class easy_install(Command): dist_dir) return eggs finally: - rmtree(dist_dir) + _rmtree(dist_dir) log.set_verbosity(self.verbose) # restore our log verbosity def _set_fetcher_options(self, base): @@ -2289,8 +2290,8 @@ def load_launcher_manifest(name): return manifest.decode('utf-8') % vars() -def rmtree(path, ignore_errors=False, onerror=auto_chmod): - return shutil.rmtree(path, ignore_errors, onerror) +def _rmtree(path, ignore_errors=False, onexc=auto_chmod): + return _py312compat.shutil_rmtree(path, ignore_errors, onexc) def current_umask(): |