MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _getuserbase

Function _getuserbase

tools/python-3.11.9-amd64/Lib/site.py:274–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272
273# Copy of sysconfig._getuserbase()
274def _getuserbase():
275 env_base = os.environ.get("PYTHONUSERBASE", None)
276 if env_base:
277 return env_base
278
279 # Emscripten, VxWorks, and WASI have no home directories
280 if sys.platform in {"emscripten", "vxworks", "wasi"}:
281 return None
282
283 def joinuser(*args):
284 return os.path.expanduser(os.path.join(*args))
285
286 if os.name == "nt":
287 base = os.environ.get("APPDATA") or "~"
288 return joinuser(base, "Python")
289
290 if sys.platform == "darwin" and sys._framework:
291 return joinuser("~", "Library", sys._framework,
292 "%d.%d" % sys.version_info[:2])
293
294 return joinuser("~", ".local")
295
296
297# Same to sysconfig.get_path('purelib', os.name+'_user')

Callers 1

getuserbaseFunction · 0.70

Calls 2

joinuserFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected