-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
windows: work around weird bug in exec/Path
- Loading branch information
Showing
6 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from pathlib import Path | ||
from typing import Union, Sequence, List, TYPE_CHECKING | ||
|
||
PathIsh = Union[Path, str] | ||
|
||
|
||
Paths = Sequence[PathIsh] | ||
|
||
# TLDR: py37 on windows has an annoying bug.. https://github.com/karlicoss/promnesia/issues/91#issuecomment-701051074 | ||
def _fix(args: Paths) -> List[str]: | ||
return list(map(str, args)) | ||
|
||
import subprocess | ||
|
||
def run(args: Paths, **kwargs) -> subprocess.CompletedProcess: | ||
return subprocess.run(_fix(args), **kwargs) | ||
|
||
def check_call(args: Paths, **kwargs) -> None: | ||
subprocess.check_call(_fix(args), **kwargs) | ||
|
||
def check_output(args: Paths, **kwargs) -> bytes: | ||
return subprocess.check_output(_fix(args), **kwargs) | ||
|
||
def Popen(args: Paths, **kwargs) -> subprocess.Popen: | ||
return subprocess.Popen(_fix(args), **kwargs) | ||
|
||
PIPE = subprocess.PIPE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters