mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-27 03:33:24 +00:00
Merge pull request #300 from DidierRLopes/fix-input-exception
Fix input exception
This commit is contained in:
@@ -9,7 +9,11 @@ from prompt_toolkit.history import FileHistory
|
||||
|
||||
def inputhook(inputhook_context):
|
||||
while not inputhook_context.input_is_ready():
|
||||
pyplot.pause(0.1)
|
||||
try:
|
||||
pyplot.pause(0.1)
|
||||
# pylint: disable=unused-variable
|
||||
except Exception as e: # noqa: F841
|
||||
continue
|
||||
return False
|
||||
|
||||
|
||||
@@ -18,6 +22,7 @@ history_file = os.path.join(os.path.expanduser("~"), ".gamestonk_terminal.his")
|
||||
try:
|
||||
session = PromptSession(history=FileHistory(history_file))
|
||||
set_eventloop_with_inputhook(inputhook)
|
||||
# pylint: disable=unused-variable
|
||||
except Exception as e: # noqa: F841
|
||||
print(
|
||||
"WARNING: Prompt toolkit is turned on but did not initialize successfully. Falling back to input()..."
|
||||
|
||||
Reference in New Issue
Block a user