mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-45020: Default to using frozen modules unless running from source tree. (gh-28940)
The default was "off". Switching it to "on" means users get the benefit of frozen stdlib modules without having to do anything. There's a special-case for running-in-source-tree, so contributors don't get surprised when their stdlib changes don't get used. https://bugs.python.org/issue45020
This commit is contained in:
parent
fe0d9e22a5
commit
b9cdd0fb9c
7 changed files with 91 additions and 25 deletions
|
@ -418,8 +418,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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue