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

Function _getuserbase

Lib/site.py:294–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

292
293# Copy of sysconfig._getuserbase()
294def _getuserbase():
295 env_base = os.environ.get("PYTHONUSERBASE", None)
296 if env_base:
297 return env_base
298
299 # Emscripten, iOS, tvOS, VxWorks, WASI, and watchOS have no home directories
300 if sys.platform in {"emscripten", "ios", "tvos", "vxworks", "wasi", "watchos"}:
301 return None
302
303 def joinuser(*args):
304 return os.path.expanduser(os.path.join(*args))
305
306 if os.name == "nt":
307 base = os.environ.get("APPDATA") or "~"
308 return joinuser(base, _get_implementation())
309
310 if sys.platform == "darwin" and sys._framework:
311 return joinuser("~", "Library", sys._framework,
312 "%d.%d" % sys.version_info[:2])
313
314 return joinuser("~", ".local")
315
316
317# Same to sysconfig.get_path('purelib', os.name+'_user')

Callers 1

getuserbaseFunction · 0.70

Calls 3

joinuserFunction · 0.70
_get_implementationFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…