mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-24 23:58:15 +00:00
fix: don't error out if there it no input() available
Some checks failed
Some checks failed
- Specific to jupyter notebooks
This commit is contained in:
@@ -358,7 +358,8 @@ def prompt_user_for_trace_viewing(timeout_seconds: int = 20) -> bool:
|
|||||||
try:
|
try:
|
||||||
response = input().strip().lower()
|
response = input().strip().lower()
|
||||||
result[0] = response in ["y", "yes"]
|
result[0] = response in ["y", "yes"]
|
||||||
except (EOFError, KeyboardInterrupt):
|
except (EOFError, KeyboardInterrupt, OSError, LookupError):
|
||||||
|
# Handle all input-related errors silently
|
||||||
result[0] = False
|
result[0] = False
|
||||||
|
|
||||||
input_thread = threading.Thread(target=get_input, daemon=True)
|
input_thread = threading.Thread(target=get_input, daemon=True)
|
||||||
@@ -371,6 +372,7 @@ def prompt_user_for_trace_viewing(timeout_seconds: int = 20) -> bool:
|
|||||||
return result[0]
|
return result[0]
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
|
# Suppress any warnings or errors and assume "no"
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user