1185 Commits
Author SHA1 Message Date
6295a17865 [3.15] gh-156459: Fix cleanup on error in compiler_set_qualname (GH-156462) (GH-156574)
(cherry picked from commit 8b082aa405)

Co-authored-by: Irit Katriel <[email protected]>
2026-10-10 13:58:08 +03:00
164d5fb91a [3.15] gh-156466: Fix additional compiler scope cleanup errors (GH-156547) (#156571)
Co-authored-by: Jelle Zijlstra <[email protected]>
2026-08-31 12:49:27 +03:00
c30c8a4a65 [3.15] gh-153252: Fix error handling in _PyCompile_CodeGen (GH-153253) (#153281)
gh-153252: Fix error handling in `_PyCompile_CodeGen` (GH-153253)
(cherry picked from commit a74280e669)

Co-authored-by: sobolevn <[email protected]>
2026-07-07 20:27:32 +03:00
Miss Islington (bot)andGitHub d13f5b27c8 [3.15] gh-151763: Fix OOM-0013 crash when the parser or compiler fails to allocate (GH-151968) (#152836) 2026-07-02 09:23:23 +01:00
42e81e35a0 [3.15] gh-151112: Fix crash in compiler_mod() when entering the current compilation unit fails (GH-151234) (#151350)
(cherry picked from commit 937d89c4d9)

Co-authored-by: Stan Ulbrych <[email protected]>
2026-06-11 15:22:31 +00:00
Irit KatrielandGitHub c650b51c32 gh-148973: fix segfault on mismatch between consts size and oparg in compiler (#148974) 2026-04-25 10:47:41 +01:00
Jelle ZijlstraandGitHub 5b8cd314e2 gh-137814: Fix __qualname__ of __annotate__ (#137842) 2026-04-15 21:52:30 -07:00
BrandonandGitHub ca95e979d6 gh-146442: Fix various bugs in compiler pipeline (#146443)
Fix null derefs, missing decrefs, and unchecked returns from bug report.
2026-03-30 22:04:04 +02:00
Sergey MiryanovandGitHub d19de375a2 GH-145247: Use _PyTuple_FromPair in Parser and Python (#145842)
Use _PyTuple_FromPair in Parser and Python
2026-03-11 21:08:18 +00:00
46d5106cfa gh-142349: Implement PEP 810 - Explicit lazy imports (#142351)
Co-authored-by: T. Wouters <[email protected] >
Co-authored-by: Brittany Reynoso <[email protected]>
Co-authored-by: Dino Viehland <[email protected]>
2026-02-12 00:15:33 +00:00
Mark ShannonandGitHub ae53da5758 GH-143493: Conform to spec for generator expressions while supporting virtual iterators (GH-143569)
* Moves the `GET_ITER` instruction into the generator function preamble.
  This means the the iterable is converted into an iterator during generator
  creation, as documented, but keeps it in the same code object allowing
  optimization.
2026-01-16 09:11:58 +00:00
Bartosz SławeckiandGitHub 6d05e55de0 Fix dunder name typo in compiler code comment (#143374) 2026-01-03 10:08:42 +00:00
Serhiy StorchakaandGitHub d8e6bdc0d0 gh-135801: Add the module parameter to compile() etc (GH-139652)
Many functions related to compiling or parsing Python code, such as
compile(), ast.parse(), symtable.symtable(),
and importlib.abc.InspectLoader.source_to_code() now allow to pass
the module name used when filtering syntax warnings.
2025-11-13 13:21:32 +02:00
Serhiy StorchakaandGitHub ad0a3f733b gh-131927: Do not emit PEP 765 warnings in ast.parse() (GH-139642)
ast.parse() no longer emits syntax warnings for
return/break/continue in finally (see PEP-765) -- they are only
emitted during compilation.
2025-10-30 13:00:42 +02:00
Serhiy StorchakaandGitHub 279db6bede gh-139640: Fix swallowing syntax warnings in different modules (GH-139755)
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.
2025-10-14 17:48:09 +03: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