MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / build_extension

Method build_extension

_setup.py:84–105  ·  view source on GitHub ↗
(self, ext)

Source from the content-addressed store, hash-verified

82 )
83
84 def build_extension(self, ext):
85 # "ProgramFiles(x86)" is not a valid environment variable in Cygwin but is needed for
86 # the MSVCCompiler in distutils.
87 if os.name == "nt":
88 if "ProgramFiles" in os.environ and "ProgramFiles(x86)" not in os.environ:
89 os.environ["ProgramFiles(x86)"] = os.environ["ProgramFiles"] + " (x86)"
90 name = ext.name
91 try:
92 build_ext.build_extension(self, ext)
93 except Exception:
94 if os.environ.get("PYMONGO_C_EXT_MUST_BUILD"):
95 raise
96 e = sys.exc_info()[1]
97 sys.stdout.write("%s\n" % str(e))
98 warnings.warn(
99 self.warning_message
100 % (
101 "The %s extension module" % (name,), # noqa: UP031
102 "The output above this warning shows how the compilation failed.",
103 ),
104 stacklevel=2,
105 )
106
107
108ext_modules = [

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected