MCPcopy
hub / github.com/Nuitka/Nuitka / _normalizePath

Function _normalizePath

lib/hints.py:27–51  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

25
26
27def _normalizePath(path):
28 path = os.path.abspath(path)
29
30 best = None
31
32 paths = list(sys.path)
33
34 # Nuitka standalone mode.
35 try:
36 paths.append(__nuitka_binary_dir)
37 paths.append(os.getcwd())
38 except NameError:
39 pass
40
41 for path_entry in paths:
42 path_entry = os.path.normcase(path_entry)
43
44 if os.path.normcase(path).startswith(path_entry):
45 if best is None or len(path_entry) > len(best):
46 best = path_entry
47
48 if best is not None:
49 path = "$PYTHONPATH" + path[len(best) :]
50
51 return path
52
53
54def _moduleRepr(module):

Callers 2

_moduleReprFunction · 0.85
_our_importFunction · 0.85

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…