()
| 292 | |
| 293 | # Copy of sysconfig._getuserbase() |
| 294 | def _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') |
no test coverage detected
searching dependent graphs…