mirror of https://github.com/pypa/pip
updated code
This commit is contained in:
parent
0dc566f06b
commit
b0a5b037ff
|
@ -94,19 +94,15 @@ class UninstallCommand(Command, SessionCommandMixin):
|
|||
modifying_pip="pip" in reqs_to_uninstall
|
||||
)
|
||||
|
||||
everything_okay = True
|
||||
for req in reqs_to_uninstall.values():
|
||||
uninstall_pathset = req.uninstall(
|
||||
auto_confirm=options.yes,
|
||||
verbose=self.verbosity > 0,
|
||||
)
|
||||
if uninstall_pathset:
|
||||
if req.files_skipped:
|
||||
return ERROR
|
||||
uninstall_pathset.commit()
|
||||
else:
|
||||
everything_okay = False
|
||||
if options.root_user_action == "warn":
|
||||
warn_if_run_as_root()
|
||||
if everything_okay:
|
||||
return SUCCESS
|
||||
else:
|
||||
return ERROR
|
||||
return SUCCESS
|
||||
|
|
|
@ -658,6 +658,7 @@ class InstallRequirement:
|
|||
|
||||
uninstalled_pathset = UninstallPathSet.from_dist(dist)
|
||||
uninstalled_pathset.remove(auto_confirm, verbose)
|
||||
self.files_skipped = uninstalled_pathset.files_skipped
|
||||
return uninstalled_pathset
|
||||
|
||||
def _get_archive_name(self, path: str, parentdir: str, rootdir: str) -> str:
|
||||
|
|
|
@ -352,12 +352,14 @@ class UninstallPathSet:
|
|||
def remove(self, auto_confirm: bool = False, verbose: bool = False) -> None:
|
||||
"""Remove paths in ``self._paths`` with confirmation (unless
|
||||
``auto_confirm`` is True)."""
|
||||
self.files_skipped = False
|
||||
|
||||
if not self._paths:
|
||||
logger.info(
|
||||
"Can't uninstall '%s'. No files were found to uninstall.",
|
||||
self._dist.raw_name,
|
||||
)
|
||||
self.files_skipped = True
|
||||
return
|
||||
|
||||
dist_name_version = f"{self._dist.raw_name}-{self._dist.version}"
|
||||
|
|
Loading…
Reference in New Issue