mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Update site from CPython 3.11.2
This commit is contained in:
21
Lib/site.py
vendored
21
Lib/site.py
vendored
@@ -266,8 +266,8 @@ def _getuserbase():
|
||||
if env_base:
|
||||
return env_base
|
||||
|
||||
# VxWorks has no home directories
|
||||
if sys.platform == "vxworks":
|
||||
# Emscripten, VxWorks, and WASI have no home directories
|
||||
if sys.platform in {"emscripten", "vxworks", "wasi"}:
|
||||
return None
|
||||
|
||||
def joinuser(*args):
|
||||
@@ -361,11 +361,11 @@ def getsitepackages(prefixes=None):
|
||||
continue
|
||||
seen.add(prefix)
|
||||
|
||||
libdirs = [sys.platlibdir]
|
||||
if sys.platlibdir != "lib":
|
||||
libdirs.append("lib")
|
||||
|
||||
if os.sep == '/':
|
||||
libdirs = [sys.platlibdir]
|
||||
if sys.platlibdir != "lib":
|
||||
libdirs.append("lib")
|
||||
|
||||
for libdir in libdirs:
|
||||
path = os.path.join(prefix, libdir,
|
||||
"python%d.%d" % sys.version_info[:2],
|
||||
@@ -373,10 +373,7 @@ def getsitepackages(prefixes=None):
|
||||
sitepackages.append(path)
|
||||
else:
|
||||
sitepackages.append(prefix)
|
||||
|
||||
for libdir in libdirs:
|
||||
path = os.path.join(prefix, libdir, "site-packages")
|
||||
sitepackages.append(path)
|
||||
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
|
||||
return sitepackages
|
||||
|
||||
def addsitepackages(known_paths, prefixes=None):
|
||||
@@ -418,8 +415,10 @@ def setcopyright():
|
||||
files, dirs = [], []
|
||||
# Not all modules are required to have a __file__ attribute. See
|
||||
# PEP 420 for more details.
|
||||
if hasattr(os, '__file__'):
|
||||
here = getattr(sys, '_stdlib_dir', None)
|
||||
if not here and hasattr(os, '__file__'):
|
||||
here = os.path.dirname(os.__file__)
|
||||
if here:
|
||||
files.extend(["LICENSE.txt", "LICENSE"])
|
||||
dirs.extend([os.path.join(here, os.pardir), here, os.curdir])
|
||||
builtins.license = _sitebuiltins._Printer(
|
||||
|
||||
Reference in New Issue
Block a user