MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / to_os_native_path

Function to_os_native_path

src/commoncode/testcase.py:42–48  ·  view source on GitHub ↗

Normalize a path to use the native OS path separator.

(path)

Source from the content-addressed store, hash-verified

40
41
42def to_os_native_path(path):
43 """
44 Normalize a path to use the native OS path separator.
45 """
46 OS_PATH_SEP = "\\" if on_windows else "/"
47
48 return path.replace("/", OS_PATH_SEP).replace("\\", OS_PATH_SEP).rstrip(OS_PATH_SEP)
49
50
51def get_test_loc(

Callers 3

get_test_locFunction · 0.85
get_temp_dirMethod · 0.85
__extractMethod · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected