8000 bpo-45020: Default to using frozen modules only on non-debug builds. by ericsnowcurrently · Pull Request #28590 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-45020: Default to using frozen modules only on non-debug builds. #28590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Show FROZEN_MODULES_DEFAULT in sysconfig data.
  • Loading branch information
ericsnowcurrently committed Sep 27, 2021
commit 60b869489c53ea464ef5308e98bb5656b3345d5e
7 changes: 7 additions & 0 deletions Lib/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ def _generate_posix_vars():
if _PYTHON_BUILD:
vars['BLDSHARED'] = vars['LDSHARED']

Py_DEBUG = bool(vars['Py_DEBUG'])
vars['FROZEN_MODULES_DEFAULT'] = 0 if Py_DEBUG else 1

# There's a chicken-and-egg situation on OS X with regards to the
# _sysconfigdata module after the changes introduced by #15298:
# get_config_vars() is called by get_platform() as part of the
Expand Down Expand Up @@ -490,6 +493,10 @@ def _init_non_posix(vars):
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
vars['TZPATH'] = ''
# infer build vars
Py_DEBUG = hasattr(sys, 'gettotalrefcount')
vars['Py_DEBUG'] = 1 if Py_DEBUG else 0
vars['FROZEN_MODULES_DEFAULT'] = 0 if Py_DEBUG else 1

#
# public APIs
Expand Down
0