gh-119205: Fix autocompletion bug in new repl (#119229)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Koudai Aono 2024-05-21 19:22:21 -04:00 committed by GitHub
parent a3e4fec873
commit 506b1a3ff6
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
@ -301,7 +302,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