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

Method create_module

Lib/test/test_pkgutil.py:574–579  ·  view source on GitHub ↗
(self, name, contents)

Source from the content-addressed store, hash-verified

572 shutil.rmtree(self.basedir)
573
574 def create_module(self, name, contents):
575 base, final = name.rsplit('.', 1)
576 base_path = os.path.join(self.basedir, base.replace('.', os.path.sep))
577 os.makedirs(base_path, exist_ok=True)
578 with open(os.path.join(base_path, final + ".py"), 'w') as f:
579 f.write(contents)
580
581 def test_nested(self):
582 pkgutil_boilerplate = (

Callers 1

test_nestedMethod · 0.95

Calls 5

openFunction · 0.50
rsplitMethod · 0.45
joinMethod · 0.45
replaceMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected