Skip to content

Commit e1f9ce2

Browse files
committed
Combine if statements
1 parent 26c2ffe commit e1f9ce2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

shelloracle/shelloracle.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ def get_query_from_pipe() -> str | None:
2828
:raises ValueError: If the input is more than one line
2929
:return: The query from the stdin pipe
3030
"""
31-
if os.isatty(0): # Return 'None' if fd 0 is a tty (no pipe)
32-
return None
33-
if not (lines := sys.stdin.readlines()):
31+
if os.isatty(0) or not (lines := sys.stdin.readlines()): # Return 'None' if fd 0 is a tty (no pipe)
3432
return None
3533
if len(lines) > 1:
3634
raise ValueError("Multi-line input not supported")

0 commit comments

Comments
 (0)