llnl.path: make system_path_filter a noop on non-win32 (#48032)
This commit is contained in:
parent
a3985e7538
commit
03525528d6
@ -66,7 +66,7 @@ def _is_url(path_or_url: str) -> bool:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def system_path_filter(_func=None, arg_slice: Optional[slice] = None):
|
def _system_path_filter(_func=None, arg_slice: Optional[slice] = None):
|
||||||
"""Filters function arguments to account for platform path separators.
|
"""Filters function arguments to account for platform path separators.
|
||||||
Optional slicing range can be specified to select specific arguments
|
Optional slicing range can be specified to select specific arguments
|
||||||
|
|
||||||
@ -100,6 +100,16 @@ def path_filter_caller(*args, **kwargs):
|
|||||||
return holder_func
|
return holder_func
|
||||||
|
|
||||||
|
|
||||||
|
def _noop_decorator(_func=None, arg_slice: Optional[slice] = None):
|
||||||
|
return _func if _func else lambda x: x
|
||||||
|
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
|
system_path_filter = _system_path_filter
|
||||||
|
else:
|
||||||
|
system_path_filter = _noop_decorator
|
||||||
|
|
||||||
|
|
||||||
def sanitize_win_longpath(path: str) -> str:
|
def sanitize_win_longpath(path: str) -> str:
|
||||||
"""Strip Windows extended path prefix from strings
|
"""Strip Windows extended path prefix from strings
|
||||||
Returns sanitized string.
|
Returns sanitized string.
|
||||||
|
Loading…
Reference in New Issue
Block a user