File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,20 @@ def _colorama_workaround() -> None:
8080 pass
8181
8282
83+ def _readline_workaround () -> None :
84+ """Ensure :mod:`readline` is imported as it fails otherwise when the
85+ ``editline`` (``libedit``) backend is used.
86+
87+ Since Python 3.13, :mod:`readline` is imported at the root of the
88+ :mod:`pdb` module, as a side effect of importing :mod:`rlcompleter`.
89+ """
90+ if sys .version_info >= (3 , 13 ):
91+ try :
92+ import readline # noqa: F401
93+ except ImportError :
94+ pass
95+
96+
8397def _windowsconsoleio_workaround (stream : TextIO ) -> None :
8498 """Workaround for Windows Unicode console handling.
8599
@@ -141,6 +155,7 @@ def pytest_load_initial_conftests(early_config: Config) -> Generator[None]:
141155 if ns .capture == "fd" :
142156 _windowsconsoleio_workaround (sys .stdout )
143157 _colorama_workaround ()
158+ _readline_workaround ()
144159 pluginmanager = early_config .pluginmanager
145160 capman = CaptureManager (ns .capture )
146161 pluginmanager .register (capman , "capturemanager" )
You can’t perform that action at this time.
0 commit comments