Closed Vuizur closed 11 months ago
It looks like this would fix it. I could open a PR if you agree:
def location_in_path(location, path):
return normpath(location) in (normpath(p) for p in path.split(os.pathsep) if p != '')
The PATH ends with ; - the split function returns "" as the last item of the array, which is then normalized using normpath to the user's current path.
It does this even if the current working directory is not in PATH. (Feel free to correct me if this is intended behaviour.)
Thanks a lot for developing this library!