Skip to content

Commit

Permalink
Merge branch 'readability-nested-side-effect-call' into 'master'
Browse files Browse the repository at this point in the history
Improve readability by removing a nested call() with side effects

See merge request i4/infra/wake-on-lan!2
  • Loading branch information
Flowdalic committed Aug 29, 2022
2 parents 661eebb + 7318fa7 commit a1df4c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wol.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def handle(self):
hostname = self.rfile.readline().strip()
if hostname:
logging.info('Request WoL at "{}" from {}'.format(hostname, client))
self.wfile.write(b"success\n" if wake(hostname) else b"failed\n")
success = wake(hostname)
self.wfile.write(b"success\n" if success else b"failed\n")
else:
break
except socket.timeout:
Expand Down

0 comments on commit a1df4c0

Please sign in to comment.