Skip to content

Commit

Permalink
Remove python 3.9 specific syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharsadhwani committed May 10, 2021
1 parent cf9f98b commit 633f867
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions zx.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ def run_shell(command: str, print_it: bool = False) -> Optional[str]:
if not print_it:
return process.stdout.read().decode()

while char := process.stdout.read(1):
if print_it:
sys.stdout.buffer.write(char)
sys.stdout.flush()
while True:
char = process.stdout.read(1)
if not char:
break

sys.stdout.buffer.write(char)
sys.stdout.flush()

return None

Expand Down

0 comments on commit 633f867

Please sign in to comment.