/usr/share/cagefs-skeleton/opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools
"""Convenience layer on top of stdlib's shutil and os""" import os import stat from typing import Callable, TypeVar from .compat import py311 from distutils import log try: from os import chmod # pyright: ignore[reportAssignmentType] # Losing type-safety w/ pyright, but that's ok except ImportError: # pragma: no cover # Jython compatibility def chmod(*args: object, **kwargs: object) -> None: # type: ignore[misc] # Mypy reuses the imported definition anyway pass _T = TypeVar("_T") def attempt_chmod_verbose(path, mode): log.debug("changing mode of %s to %o", path, mode) try: chmod(path, mode) except OSError as e: # pragma: no cover log.debug("chmod failed: %s", e) # Must match shutil._OnExcCallback def _auto_chmod( func: Callable[..., _T], arg: str, exc: BaseException ) -> _T: # pragma: no cover """shutils onexc callback to automatically call chmod for certain functions.""" # Only retry for scenarios known to have an issue if func in [os.unlink, os.remove] and os.name == 'nt': attempt_chmod_verbose(arg, stat.S_IWRITE) return func(arg) raise exc def rmtree(path, ignore_errors=False, onexc=_auto_chmod): """ Similar to ``shutil.rmtree`` but automatically executes ``chmod`` for well know Windows failure scenarios. """ return py311.shutil_rmtree(path, ignore_errors, onexc) def rmdir(path, **opts): if os.path.isdir(path): rmtree(path, **opts)
.
Edit
..
Edit
__init__.py
Edit
__pycache__
Edit
_core_metadata.py
Edit
_distutils
Edit
_entry_points.py
Edit
_imp.py
Edit
_importlib.py
Edit
_itertools.py
Edit
_normalization.py
Edit
_path.py
Edit
_reqs.py
Edit
_shutil.py
Edit
_static.py
Edit
_vendor
Edit
archive_util.py
Edit
build_meta.py
Edit
cli-32.exe
Edit
cli-64.exe
Edit
cli-arm64.exe
Edit
cli.exe
Edit
command
Edit
compat
Edit
config
Edit
depends.py
Edit
discovery.py
Edit
dist.py
Edit
errors.py
Edit
extension.py
Edit
glob.py
Edit
gui-32.exe
Edit
gui-64.exe
Edit
gui-arm64.exe
Edit
gui.exe
Edit
installer.py
Edit
launch.py
Edit
logging.py
Edit
modified.py
Edit
monkey.py
Edit
msvc.py
Edit
namespaces.py
Edit
package_index.py
Edit
sandbox.py
Edit
script (dev).tmpl
Edit
script.tmpl
Edit
tests
Edit
unicode_utils.py
Edit
version.py
Edit
warnings.py
Edit
wheel.py
Edit
windows_support.py
Edit