Skip to content

Commit

Permalink
Use iter() instead of while True
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka committed Aug 20, 2014
1 parent e326457 commit 0f86712
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions rsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,8 @@ def handle(self):
session = Session(self.request)
self.request.send(b"Sublime Text 2 (rsub plugin)\n")

socket_fd = self.request.makefile("rb")
while True:
line = socket_fd.readline()
if len(line) == 0:
break
socket_fd = self.request.makefile('rb')
for line in iter(socket_fd.readline, ""):
session.parse_input(line)

say('Connection close.')
Expand Down

0 comments on commit 0f86712

Please sign in to comment.