Skip to content

Commit

Permalink
Fixed issue #37 (Windows issue), where invoking os.path.relpath(path)…
Browse files Browse the repository at this point in the history
… raises a ValueError when the path of the executable is on a different drive than the current directory, Returning basedir as executable name seems appropriate in this case.
  • Loading branch information
scholer authored and epsy committed Nov 28, 2018
1 parent 2885fc1 commit e19e849
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clize/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ def get_executable(path, default):
else:
if which(basename) == path:
return basename
rel = os.path.relpath(path)
try:
rel = os.path.relpath(path)
except ValueError:
return basename
if rel.startswith('../'):
if which is None and os.path.isabs(path):
return basename
Expand Down

0 comments on commit e19e849

Please sign in to comment.