8000 Use sys._stdlib_dir to find the stdlib dir. · python/cpython@b2aa67d · GitHub
[go: up one dir, main page]

Skip to content

Commit b2aa67d

Browse files
Use sys._stdlib_dir to find the stdlib dir.
1 parent 69242c0 commit b2aa67d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/site.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,10 @@ def setcopyright():
418418
files, dirs = [], []
419419
# Not all modules are required to have a __file__ attribute. See
420420
# PEP 420 for more details.
421-
if hasattr(os, '__file__'):
421+
here = getattr(sys, '_stdlib_dir', None)
422+
if not here and hasattr(os, '__file__'):
422423
here = os.path.dirname(os.__file__)
424+
if here:
423425
files.extend(["LICENSE.txt", "LICENSE"])
424426
dirs.extend([os.path.join(here, os.pardir), here, os.curdir])
425427
builtins.license = _sitebuiltins._Printer(

0 commit comments

Comments
 (0)
0