gh-118817: Fix asyncio REPL on Windows (#118819)

This commit is contained in:
Kirill Podoprigora 2024-05-09 18:20:46 +03:00 committed by GitHub
parent 35b5eaa176
commit c3643a1214
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -108,7 +108,7 @@ if __name__ == '__main__':
try:
import readline # NoQA
except ImportError:
pass
readline = None
interactive_hook = getattr(sys, "__interactivehook__", None)
@ -122,8 +122,9 @@ if __name__ == '__main__':
except:
pass
else:
completer = rlcompleter.Completer(console.locals)
readline.set_completer(completer.complete)
if readline is not None:
completer = rlcompleter.Completer(console.locals)
readline.set_completer(completer.complete)
repl_thread = REPLThread()
repl_thread.daemon = True