diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py index 242df7d82..28b255677 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -23,11 +23,7 @@ from pip._internal.cli import cmdoptions from pip._internal.cli.cmdoptions import make_target_python from pip._internal.cli.req_command import RequirementCommand, with_cleanup from pip._internal.cli.status_codes import ERROR, SUCCESS -from pip._internal.exceptions import ( - CommandError, - InstallationError, - PreviousBuildDirError, -) +from pip._internal.exceptions import CommandError, InstallationError from pip._internal.locations import distutils_scheme from pip._internal.operations.check import check_install_conflicts from pip._internal.req import install_given_reqs @@ -438,9 +434,6 @@ class InstallCommand(RequirementCommand): logger.error(message, exc_info=show_traceback) return ERROR - except PreviousBuildDirError: - options.no_clean = True - raise if options.target_dir: self._handle_target_dir( diff --git a/src/pip/_internal/commands/wheel.py b/src/pip/_internal/commands/wheel.py index a5bf28c94..d6fc81124 100644 --- a/src/pip/_internal/commands/wheel.py +++ b/src/pip/_internal/commands/wheel.py @@ -12,7 +12,7 @@ import shutil from pip._internal.cache import WheelCache from pip._internal.cli import cmdoptions from pip._internal.cli.req_command import RequirementCommand, with_cleanup -from pip._internal.exceptions import CommandError, PreviousBuildDirError +from pip._internal.exceptions import CommandError from pip._internal.req.req_tracker import get_requirement_tracker from pip._internal.utils.misc import ensure_dir, normalize_path from pip._internal.utils.temp_dir import TempDirectory @@ -127,7 +127,7 @@ class WheelCommand(RequirementCommand): with get_requirement_tracker() as req_tracker, TempDirectory( options.build_dir, delete=build_delete, kind="wheel" ) as directory: - try: + if True: # Keep block indented temporarily, for a cleaner commit reqs = self.get_requirements( args, options, finder, session, wheel_cache @@ -186,6 +186,3 @@ class WheelCommand(RequirementCommand): raise CommandError( "Failed to build one or more wheels" ) - except PreviousBuildDirError: - options.no_clean = True - raise