summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/_pyrepl/readline.py4
-rw-r--r--Lib/test/test_pyrepl/__init__.py1
-rw-r--r--Misc/NEWS.d/next/Library/2024-05-20-20-30-57.gh-issue-111201.DAA5lC.rst1
3 files changed, 3 insertions, 3 deletions
diff --git a/Lib/_pyrepl/readline.py b/Lib/_pyrepl/readline.py
index 0adecf2..9c85ce1 100644
--- a/Lib/_pyrepl/readline.py
+++ b/Lib/_pyrepl/readline.py
@@ -31,9 +31,9 @@ from __future__ import annotations
from dataclasses import dataclass, field
import os
-import readline
from site import gethistoryfile # type: ignore[attr-defined]
import sys
+from rlcompleter import Completer as RLCompleter
from . import commands, historical_reader
from .completing_reader import CompletingReader
@@ -84,7 +84,7 @@ __all__ = [
@dataclass
class ReadlineConfig:
- readline_completer: Completer | None = readline.get_completer()
+ readline_completer: Completer | None = RLCompleter().complete
completer_delims: frozenset[str] = frozenset(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?")
diff --git a/Lib/test/test_pyrepl/__init__.py b/Lib/test/test_pyrepl/__init__.py
index a9bc41f..fa38b86 100644
--- a/Lib/test/test_pyrepl/__init__.py
+++ b/Lib/test/test_pyrepl/__init__.py
@@ -7,7 +7,6 @@ from test.support.import_helper import import_module
# option. Additionally, we need to attempt to import curses and readline.
requires("curses")
curses = import_module("curses")
-readline = import_module("readline")
def load_tests(*args):
diff --git a/Misc/NEWS.d/next/Library/2024-05-20-20-30-57.gh-issue-111201.DAA5lC.rst b/Misc/NEWS.d/next/Library/2024-05-20-20-30-57.gh-issue-111201.DAA5lC.rst
new file mode 100644
index 0000000..15cd79d
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-05-20-20-30-57.gh-issue-111201.DAA5lC.rst
@@ -0,0 +1 @@
+Remove dependency to :mod:`readline` from the new Python REPL.