1179 Commits
Author SHA1 Message Date
a53b1324fc [3.14] gh-156459: Fix cleanup on error in compiler_set_qualname (GH-156462) (#156575)
Co-authored-by: Irit Katriel <[email protected]>
2026-10-23 20:35:42 +03:00
bf85294394 [3.14] gh-156466: Fix additional compiler scope cleanup errors (GH-156547) (#156572)
gh-156466: Fix additional compiler scope cleanup errors (GH-156547)
(cherry picked from commit f4874f381c)

Co-authored-by: Jelle Zijlstra <[email protected]>
2026-08-29 12:42:26 +00:00
3d802b5be9 [3.14] gh-153252: Fix error handling in _PyCompile_CodeGen (GH-153253) (#153282)
gh-153252: Fix error handling in `_PyCompile_CodeGen` (GH-153253)
(cherry picked from commit a74280e669)

Co-authored-by: sobolevn <[email protected]>
2026-07-07 18:02:59 +00:00
Miss Islington (bot)andGitHub 74c8d5ce0f [3.14] gh-151763: Fix OOM-0013 crash when the parser or compiler fails to allocate (GH-151968) (#152837) 2026-07-02 09:23:07 +01:00
5f8546e22f [3.14] gh-151112: Fix crash in compiler_mod() when entering the current compilation unit fails (GH-151234) (#151351)
(cherry picked from commit 937d89c4d9)

Co-authored-by: Stan Ulbrych <[email protected]>
2026-06-11 15:16:58 +00:00
8acb98a1c2 [3.14] gh-148973: fix segfault on mismatch between consts size and oparg in compiler (GH-148974) (#148980)
gh-148973: fix segfault on mismatch between consts size and oparg in compiler (GH-148974)
(cherry picked from commit c650b51c32)

Co-authored-by: Irit Katriel <[email protected]>
2026-04-25 13:53:42 +01:00
fca010da50 [3.14] Fix dunder name typo in compiler code comment (GH-143374) (#143386)
Fix dunder name typo in compiler code comment (GH-143374)
(cherry picked from commit 6d05e55de0)

Co-authored-by: Bartosz Sławecki <[email protected]>
2026-01-10 12:21:09 +05:30
a7cfe862ba [3.14] gh-131927: Do not emit PEP 765 warnings in ast.parse() (GH-139642) (GH-140786)
ast.parse() no longer emits syntax warnings for
return/break/continue in finally (see PEP-765) -- they are only
emitted during compilation.
(cherry picked from commit ad0a3f733b)

Co-authored-by: Serhiy Storchaka <[email protected]>
2025-10-30 11:25:34 +00:00
af28efd8b4 [3.14] gh-139640: Fix swallowing syntax warnings in different modules (GH-139755) (GH-140117)
Revert GH-131993.

Fix swallowing some syntax warnings in different modules if they accidentally
have the same message and are emitted from the same line.

Fix duplicated warnings in the "finally" block.

(cherry picked from commit 279db6bede)

Co-authored-by: Serhiy Storchaka <[email protected]>

* Update 2025-10-06-10-03-37.gh-issue-139640.gY5oTb.rst

---------

Co-authored-by: Serhiy Storchaka <[email protected]>
2025-10-14 15:56:01 +00:00
Yan YanchiiandGitHub 0a1fedb70b gh-126835: Rename ast_opt.c to ast_preprocess.c and related stuff after moving const folding to the peephole optimizier (#131830) 2025-05-04 21:07:35 +03:00
Jelle ZijlstraandGitHub 922049b613 gh-130907: Treat all module-level annotations as conditional (#131550) 2025-04-28 06:10:28 -07:00
Jelle ZijlstraandGitHub 898e6b395e gh-130881: Handle conditionally defined annotations (#130935) 2025-03-26 03:48:19 +00:00
Irit KatrielandGitHub ffc2f1dd1c gh-130080: implement PEP 765 (#130087) 2025-03-17 20:48:54 +00:00
Mark ShannonandGitHub a45f25361d GH-131238: More refactoring of core header files (GH-131351)
Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
2025-03-17 14:41:05 +00:00
Victor StinnerandGitHub 978e37bb5f gh-131238: Add explicit includes to pycore headers (#131257) 2025-03-17 12:32:43 +01:00
Hugo Beauzée-LuyssenandGitHub 830f04b505 Postpone <stdbool.h> inclusion after Python.h (#130641)
Remove inclusions prior to Python.h.

<stdbool.h> will cause <features.h> to be included before Python.h can
define some macros to enable some additional features, causing multiple
types not to be defined down the line.
2025-02-28 10:09:27 +01:00
Victor StinnerandGitHub 95504f429e gh-129354: Fix grammar in PyErr_FormatUnraisable() (#129475)
Replace "on verb+ing" with "while verb+ing".
2025-01-31 09:45:35 +01:00
mpageandGitHub 255762c09f gh-127274: Defer nested methods (#128012)
Methods (functions defined in class scope) are likely to be cleaned
up by the GC anyway.

Add a new code flag, `CO_METHOD`, that is set for functions defined
in a class scope. Use that when deciding to defer functions.
2024-12-19 13:03:14 -08:00
Bénédikt TranandGitHub c222441fa7 gh-120017: use 'do-while(0)' in some {codegen,compile}.c multi-line macros (#120018) 2024-11-07 23:03:11 +00:00
Valery FedorenkoGitHubblurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Peter Bierma
8525c9375f gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (#126239)
* Replace Py_DECREF by Py_XDECREF

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
2024-11-05 20:34:33 +03:00
Xuanteng HuangandGitHub 35df4eb959 gh-126072: do not add None to co_consts if there is no docstring (GH-126101) 2024-10-30 09:01:09 +00:00
Mikhail EfimovandGitHub 9a35d05338 gh-121404: typo fix in compile.c: MATADATA -> METADATA (#125101) 2024-10-08 12:18:28 +00:00
04c837d9d8 gh-124442: make __static_attributes__ deterministic by sorting (#124492)
Signed-off-by: kp2pml30 <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
2024-09-28 15:15:43 -07:00
Irit KatrielandGitHub aba42c0b54 gh-123969: refactor _PyErr_RaiseSyntaxError and _PyErr_EmitSyntaxWarning out of compiler (#123972) 2024-09-16 15:05:00 +01:00
Irit KatrielandGitHub 9aa1f60e2d gh-124058: remove _PyCompile_IsNestedScope, roll it into _PyCompile_IsInteractive (#124061) 2024-09-16 06:58:18 -07:00
a9594a34c6 gh-124022: Fix bug where class docstring is removed in interactive mode (#124023)
Co-authored-by: Jelle Zijlstra <[email protected]>
2024-09-13 14:06:06 +00:00
Irit KatrielandGitHub 8145ebea58 gh-124013: remove _PyCompile_IsTopLevelAwait (#124014) 2024-09-12 19:58:32 +01:00
Irit KatrielandGitHub a2d0818c85 gh-123881: make compiler add the .generic_base base class without constructing AST nodes (#123883) 2024-09-10 16:16:00 +00:00
Irit KatrielandGitHub 1a9d8917a3 gh-121404: split compile.c into compile.c and codegen.c (#123651) 2024-09-09 18:21:51 +01:00
Irit KatrielandGitHub fbb26f067a gh-121404: enforce that codegen doesn't access compiler, and compiler doesn't use codegen macros (#123575) 2024-09-02 17:23:39 +00:00
sobolevnandGitHub 91b7f2e7f6 gh-123553: Fix compile warning in compile.c (#123578) 2024-09-01 15:43:45 +00:00
Kirill PodoprigoraandGitHub 084e0f35d1 gh-123553: Fix compiler warning in Python/compile.c (#123554) 2024-09-01 06:29:34 +00:00
Irit KatrielandGitHub 6bfbfc6af3 gh-121404: rearrange code in compile.c so that codegen functions come first and compiler functions second (#123510) 2024-08-30 22:54:42 +01:00
Irit KatrielandGitHub 61bef6245c gh-123142: fix too wide source location of GET_ITER/GET_AITER (#123420) 2024-08-28 17:11:52 +01:00
Irit KatrielandGitHub d24d1c986d gh-121404: split compiler_nameop into a codegen part and a compiler part (#123398) 2024-08-27 16:57:31 +01:00
Irit KatrielandGitHub da4302699f gh-121404: compiler_visit_* --> codegen_visit_* (#123382) 2024-08-27 11:32:24 +00:00
Irit KatrielandGitHub bf1b5d323b gh-121404: more compiler_* -> codegen_*, class_body and comprehensions (#123262) 2024-08-23 19:53:15 +01:00
Irit KatrielandGitHub 5fce482c9a gh-121404: compiler_annassign --> codegen_annassign (#123245) 2024-08-23 10:39:42 +01:00
Irit KatrielandGitHub 4abc1c1456 gh-121404: remove redundant c_nestlevel. more compiler abstractions. more macro usage consistency (#123225) 2024-08-22 15:08:16 +01:00
Irit KatrielandGitHub ec89620e5e gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions (#123173) 2024-08-21 19:12:05 +01:00
Irit KatrielandGitHub 4b7c4880a0 gh-121404: split fblock handling into compiler_* and codegen_* parts (#123199) 2024-08-21 15:48:56 +01:00
Irit KatrielandGitHub bffed80230 gh-123048: Fix missing source location in pattern matching code (#123167) 2024-08-20 11:39:41 +01:00
Irit KatrielandGitHub b6d0a40a42 gh-121404: rename functions to use codegen_* prefix. Use macros more consistently. (#123139) 2024-08-19 14:39:53 +00:00
Irit KatrielandGitHub e077b201f4 gh-121404: pass metadata to compiler_enter_scope (optionally) so that codegen functions don't need to set it on the code unit (#123078) 2024-08-19 11:49:42 +01:00
Irit KatrielandGitHub e2f2dc708e gh-121404: rename compiler_addop* to codegen_addop*, and replace direct usages by the macros (#123043) 2024-08-16 15:57:32 +01:00
Irit KatrielandGitHub b6cb435ac0 gh-121404: split compiler's push/pop_inlined_comprehension_state into codegen and compiler parts (#123021) 2024-08-15 11:08:54 +00:00
Irit KatrielandGitHub 05fc4d758a gh-122985: add SYMBOL_TO_SCOPE macro in symtable (#122986) 2024-08-14 06:17:04 +01:00
Mark ShannonandGitHub fe23f8ed97 GH-122821: Simplify compilation of while statements to ensure consistency of offsets for sys.monitoring (GH-122934) 2024-08-13 10:25:44 +01:00
Serhiy StorchakaandGitHub e74680b718 gh-122595: Add more error checks in the compiler (GH-122596) 2024-08-06 08:59:44 +03:00
Irit KatrielandGitHub 498376d7a7 gh-122445: populate only modified fields in __static_attributes__ (#122446) 2024-08-02 15:40:42 +01:00