MCPcopy Index your code
hub / github.com/RustPython/RustPython / load_file

Method load_file

Lib/modulefinder.py:160–165  ·  view source on GitHub ↗
(self, pathname)

Source from the content-addressed store, hash-verified

158 self.load_module('__main__', fp, pathname, stuff)
159
160 def load_file(self, pathname):
161 dir, name = os.path.split(pathname)
162 name, ext = os.path.splitext(name)
163 with io.open_code(pathname) as fp:
164 stuff = (ext, "rb", _PY_SOURCE)
165 self.load_module(name, fp, pathname, stuff)
166
167 def import_hook(self, name, caller=None, fromlist=None, level=-1):
168 self.msg(3, "import_hook", name, caller, fromlist, level)

Callers 1

testFunction · 0.95

Calls 3

load_moduleMethod · 0.95
splitextMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected