MCPcopy
hub / github.com/Nuitka/Nuitka / _normalizeModuleFilename

Function _normalizeModuleFilename

nuitka/ModuleRegistry.py:117–132  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

115
116
117def _normalizeModuleFilename(filename):
118 if python_version >= 0x300:
119 filename = filename.replace("__pycache__", "")
120
121 suffix = ".cpython-%d.pyc" % (python_version // 10)
122
123 if filename.endswith(suffix):
124 filename = filename[: -len(suffix)] + ".py"
125 else:
126 if filename.endswith(".pyc"):
127 filename = filename[:-3] + ".py"
128
129 if os.path.basename(filename) == "__init__.py":
130 filename = os.path.dirname(filename)
131
132 return filename
133
134
135def startTraversal():

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…