mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
gh-124022: Fix bug where class docstring is removed in interactive mode (#124023)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
cfe6074d1f
commit
a9594a34c6
5 changed files with 37 additions and 12 deletions
|
@ -790,13 +790,13 @@ compiler_codegen(compiler *c, mod_ty mod)
|
|||
switch (mod->kind) {
|
||||
case Module_kind: {
|
||||
asdl_stmt_seq *stmts = mod->v.Module.body;
|
||||
RETURN_IF_ERROR(_PyCodegen_Body(c, start_location(stmts), stmts));
|
||||
RETURN_IF_ERROR(_PyCodegen_Body(c, start_location(stmts), stmts, false));
|
||||
break;
|
||||
}
|
||||
case Interactive_kind: {
|
||||
c->c_interactive = 1;
|
||||
asdl_stmt_seq *stmts = mod->v.Interactive.body;
|
||||
RETURN_IF_ERROR(_PyCodegen_Body(c, start_location(stmts), stmts));
|
||||
RETURN_IF_ERROR(_PyCodegen_Body(c, start_location(stmts), stmts, true));
|
||||
break;
|
||||
}
|
||||
case Expression_kind: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue