MCPcopy Index your code
hub / github.com/RustPython/RustPython / _getuserbase

Function _getuserbase

Lib/site.py:296–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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