From 85c19d2b1981bde1f15c5cafb8abc455b67f83cd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 30 Jan 2025 12:44:27 +0100 Subject: [PATCH] Handle no readline on Windows --- src/_pytest/capture.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 8487af6a360..5b64c34e772 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -91,7 +91,10 @@ def _readline_workaround() -> None: workaround consists of importing readline here, so we already worked around the issue by the time we could check if we need to. """ - import readline # noqa: F401 + try: + import readline # noqa: F401 + except ImportError: + pass def _windowsconsoleio_workaround(stream: TextIO) -> None: