[3.13] gh-118908: Fix completions after namespace change in REPL (GH-120370) (#120392)

(cherry picked from commit 02e74c3562)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-06-12 10:48:22 +02:00 committed by GitHub
parent 8f5ce42f34
commit 10821ccf06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View file

@ -96,9 +96,9 @@ def run_multiline_interactive_console(
console: code.InteractiveConsole | None = None,
) -> None:
from .readline import _setup
_setup()
namespace = mainmodule.__dict__ if mainmodule else DEFAULT_NAMESPACE
_setup(namespace)
if console is None:
console = InteractiveColoredConsole(
namespace, filename="<stdin>"