MCPcopy Index your code
hub / github.com/python/cpython / create_module

Method create_module

Lib/importlib/_bootstrap.py:1078–1088  ·  view source on GitHub ↗

Set __file__, if able.

(spec)

Source from the content-addressed store, hash-verified

1076
1077 @staticmethod
1078 def create_module(spec):
1079 """Set __file__, if able."""
1080 module = _new_module(spec.name)
1081 try:
1082 filename = spec.loader_state.filename
1083 except AttributeError:
1084 pass
1085 else:
1086 if filename:
1087 module.__file__ = filename
1088 return module
1089
1090 @staticmethod
1091 def exec_module(module):

Callers 1

module_from_specFunction · 0.45

Calls 1

_new_moduleFunction · 0.85

Tested by

no test coverage detected