Skip to content

Commit 499eeed

Browse files
authored
Fix: Wrap is_interactive() checks in an exception handler, enables running in ASGI environments (#263)
1 parent ad850f0 commit 499eeed

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

airbyte/_util/meta.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,16 @@ def is_colab() -> bool:
5656

5757
@lru_cache
5858
def is_interactive() -> bool:
59-
if is_colab() or is_jupyter():
60-
return True
59+
try:
60+
if is_colab() or is_jupyter():
61+
return True
6162

62-
if is_ci():
63-
return False
63+
if is_ci():
64+
return False
6465

65-
return bool(sys.__stdin__.isatty() and sys.__stdout__.isatty())
66+
return bool(sys.__stdin__.isatty() and sys.__stdout__.isatty())
67+
except Exception:
68+
return False
6669

6770

6871
@lru_cache

0 commit comments

Comments
 (0)