Skip to content

Commit 7aa7c8c

Browse files
Publish site from main (cpython@main) 5a2cae0
1 parent b288679 commit 7aa7c8c

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

driver.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ def _co_consts_from_metadata(metadata):
284284
if not metadata:
285285
return None
286286
consts = metadata.get("consts")
287+
if isinstance(consts, list):
288+
return list(consts) if consts else None
287289
if not isinstance(consts, dict) or not consts:
288290
return None
289291
# compiler metadata stores const->index and indices may be sparse.
@@ -404,10 +406,7 @@ def view_pseudo(code: str, *, optimize: bool = False) -> dict[str, Any]:
404406
co_consts = _merge_co_consts(
405407
_co_consts_from_metadata(metadata), _compiled_co_consts(code)
406408
)
407-
# On some newer WASM builds (e.g. CPython 3.15 snapshots), optimize_cfg can
408-
# trap at runtime with low-level wasm errors. Prefer a stable pseudo view
409-
# there instead of crashing the whole worker process.
410-
if optimize and sys.version_info < (3, 15):
409+
if optimize:
411410
insts = optimize_cfg(insts, co_consts, 0)
412411
items = _instruction_items(insts)
413412
adjusted_consts = _apply_annotations_const_workaround(items, co_consts)

python3.15.zip

469 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)