Skip to content

Commit

Permalink
Fix drive letter bug on Windows for the PythonResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScheller committed Oct 27, 2023
1 parent 9923791 commit ff96e86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PythonResolver/PythonExpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Utils
SYSTEM_IS_LINUX = sys.platform.lower() == "linux"
SYSTEM_IS_WINDOWS = sys.platform.lower() == "windows"
SYSTEM_IS_WINDOWS = any([w in sys.platform.lower() for w in ["windows", "win32", "win64", "cygwin"]])

def log_function_args(func):
"""Decorator to print function call details."""
Expand All @@ -42,7 +42,8 @@ def TfIsRelativePath(path):
bool: State if the path is a relative path
"""
if SYSTEM_IS_WINDOWS:
return not path or path[0] != '/' and path[0] == '\\'
drive, tail = os.path.splitdrive(path)
return not path or (path[0] != '/' and path[0] != '\\' and not drive)
else:
return not path or path[0] != '/'

Expand Down

0 comments on commit ff96e86

Please sign in to comment.