[3.13] gh-119205: Fix autocompletion bug in new repl (GH-119229) (#119407)

(cherry picked from commit 506b1a3ff6)

Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Miss Islington (bot) 2024-05-22 18:07:38 +02:00 committed by GitHub
parent aefe2e626e
commit eafd633fac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 8 deletions

View file

@ -28,6 +28,7 @@ extensions for multiline input.
from __future__ import annotations
import warnings
from dataclasses import dataclass, field
import os
@ -298,7 +299,8 @@ class _ReadlineWrapper:
reader.more_lines = more_lines
reader.ps1 = reader.ps2 = ps1
reader.ps3 = reader.ps4 = ps2
return reader.readline(), reader.was_paste_mode_activated
with warnings.catch_warnings(action="ignore"):
return reader.readline(), reader.was_paste_mode_activated
finally:
reader.more_lines = saved
reader.paste_mode = False