8000 gh-127405: Remove dead code in `sysconfig._get_pybuilddir()` by XuehaiPan · Pull Request #131935 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-127405: Remove dead code in sysconfig._get_pybuilddir() #131935

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
wants to merge 17 commits into from
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
Next Next commit
Try fix WASM build with Py_DEBUG
  • Loading branch information
XuehaiPan committed Apr 1, 2025
commit cb043128934a2f93877bec941df98edf7830e756
14 changes: 4 additions & 10 deletions Lib/sysconfig/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,6 @@ def _print_config_dict(d, stream):
print ("}", file=stream)


def _get_pybuilddir(py_debug=None):
pybuilddir = f'build/lib.{get_platform()}-{get_python_version()}'
if py_debug is None:
py_debug = get_config_var('Py_DEBUG')
if py_debug:
pybuilddir += '-pydebug'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any way for this to be called, but I note that this behavior is tied to

pydebug = lib_dir.endswith("-pydebug")

I think this aspect of the WASM build is broken, and if this code can be deleted then perhaps that trail can too.

return pybuilddir


def _get_json_data_name():
name = _get_sysconfigdata_name()
assert name.startswith('_sysconfigdata')
Expand Down Expand Up @@ -222,7 +213,10 @@ def _generate_posix_vars():
module.build_time_vars = vars
sys.modules[name] = module

pybuilddir = _get_pybuilddir(vars['Py_DEBUG'])
pybuilddir = os.environ.get(
'_PYTHON_SYSCONFIGDATA_PATH',
f'build/lib.{get_platform()}-{get_python_version()}',
)
os.makedirs(pybuilddir, exist_ok=True)
destfile = os.path.join(pybuilddir, name + '.py')

Expand Down
Loading
0