Skip to content

Commit

Permalink
continue if Windows cannot remove a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
cs01 committed Nov 19, 2018
1 parent 0c46ad9 commit 7cb6561
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 6 additions & 3 deletions pipx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ def _run(cmd: Sequence[Union[str, Path]], check=True) -> int:

def rmdir(path: Path):
logging.info(f"removing directory {path}")
shutil.rmtree(path)
if WINDOWS:
os.system(f'rmdir /S /Q "{str(path)}"')
else:
shutil.rmtree(path)


def mkdir(path: Path) -> None:
Expand Down Expand Up @@ -499,7 +502,7 @@ def get_fs_package_name(package: str) -> str:


def print_version() -> None:
print("0.9.0")
print("0.9.1")


def run_pipx_command(args):
Expand Down Expand Up @@ -633,7 +636,7 @@ def get_command_parser():
dest="command", description="Get help for commands with pipx COMMAND --help"
)
p = subparsers.add_parser(
"binary", help=("Run a binary with the given name from an ephemral virtualenv")
"binary", help=("Run a binary with the given name from an ephemeral virtualenv")
)
p.add_argument("--spec", help=SPEC_HELP)
p.add_argument("--verbose", action="store_true")
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

import io
import os
import sys
from setuptools import find_packages, setup, Command
from setuptools import find_packages, setup

CURDIR = os.path.abspath(os.path.dirname(__file__))

Expand All @@ -15,8 +14,8 @@
README = f.read()

setup(
name="pipx",
version="0.9.0",
name="pipx-app",
version="0.9.1",
author="Chad Smith",
author_email="grassfedcode@gmail.com",
description="execute binaries from Python packages in isolated environments",
Expand Down

0 comments on commit 7cb6561

Please sign in to comment.