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

Function _default_sysroot

Lib/_osx_support.py:154–177  ·  view source on GitHub ↗

Returns the root of the default SDK for this system, or '/'

(cc)

Source from the content-addressed store, hash-verified

152
153_cache_default_sysroot = None
154def _default_sysroot(cc):
155 """ Returns the root of the default SDK for this system, or '/' """
156 global _cache_default_sysroot
157
158 if _cache_default_sysroot is not None:
159 return _cache_default_sysroot
160
161 contents = _read_output('%s -c -E -v - </dev/null' % (cc,), True)
162 in_incdirs = False
163 for line in contents.splitlines():
164 if line.startswith("#include <...>"):
165 in_incdirs = True
166 elif line.startswith("End of search list"):
167 in_incdirs = False
168 elif in_incdirs:
169 line = line.strip()
170 if line == '/usr/include':
171 _cache_default_sysroot = '/'
172 elif line.endswith(".sdk/usr/include"):
173 _cache_default_sysroot = line[:-12]
174 if _cache_default_sysroot is None:
175 _cache_default_sysroot = '/'
176
177 return _cache_default_sysroot
178
179def _supports_universal_builds():
180 """Returns True if universal builds are supported on this system"""

Callers

nothing calls this directly

Calls 5

_read_outputFunction · 0.85
splitlinesMethod · 0.45
startswithMethod · 0.45
stripMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…