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

Method recompile_pymods

Tools/ssl/multissltests.py:366–387  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

364 raise ValueError(version)
365
366 def recompile_pymods(self):
367 log.warning("Using build from {}".format(self.build_dir))
368 # force a rebuild of all modules that use OpenSSL APIs
369 for fname in self.module_files:
370 os.utime(fname, None)
371 # remove all build artefacts
372 for root, dirs, files in os.walk('build'):
373 for filename in files:
374 if filename.startswith(self.module_libs):
375 os.unlink(os.path.join(root, filename))
376
377 # overwrite header and library search paths
378 env = os.environ.copy()
379 env["CPPFLAGS"] = "-I{}".format(self.include_dir)
380 env["LDFLAGS"] = "-L{}".format(self.lib_dir)
381 # set rpath
382 env["LD_RUN_PATH"] = self.lib_dir
383
384 log.info("Rebuilding Python modules")
385 cmd = ["make", "sharedmods", "checksharedmods"]
386 self._subprocess_call(cmd, env=env)
387 self.check_imports()
388
389 def check_imports(self):
390 cmd = [sys.executable, "-c", "import _ssl; import _hashlib"]

Callers 1

mainFunction · 0.80

Calls 11

_subprocess_callMethod · 0.95
check_importsMethod · 0.95
utimeMethod · 0.80
warningMethod · 0.45
formatMethod · 0.45
walkMethod · 0.45
startswithMethod · 0.45
unlinkMethod · 0.45
joinMethod · 0.45
copyMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected