Skip to content

Commit

Permalink
examples/capture.py: Resolve needless else
Browse files Browse the repository at this point in the history
.. to reduce nesting to simplify the structure.
  • Loading branch information
hartwork committed Nov 25, 2023
1 parent bb830b6 commit 1f07717
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
except (KeyboardInterrupt, # Stop right now!
ValueError): # Nothing to read.
break
else:
try:
data = os.read(master_fd, 1024)
except OSError:
break

if not data:
break
try:
data = os.read(master_fd, 1024)
except OSError:
break

if not data:
break

handle.write(data)
handle.write(data)

os.kill(p_pid, signal.SIGTERM)

0 comments on commit 1f07717

Please sign in to comment.