Executable: allow also pathlib.Path in constructor
This commit is contained in:
parent
dc96b3cbc1
commit
8f1be225dd
@ -20,9 +20,9 @@
|
||||
class Executable:
|
||||
"""Class representing a program that can be run on the command line."""
|
||||
|
||||
def __init__(self, name: str) -> None:
|
||||
def __init__(self, name: Union[str, Path]) -> None:
|
||||
file_path = str(Path(name))
|
||||
if sys.platform != "win32" and name.startswith("."):
|
||||
if sys.platform != "win32" and isinstance(name, str) and name.startswith("."):
|
||||
# pathlib strips the ./ from relative paths so it must be added back
|
||||
file_path = os.path.join(".", file_path)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user