1. ai0867
  2. irc

Commits

Jason R. Coombs  committed 98d9ccb

Simplify reading logic

  • Participants
  • Parent commits 6d3fc54
  • Branches default

Comments (0)

Files changed (1)

File irc/client.py

View file
         """[Internal]"""
 
         try:
-            if self.ssl:
-                new_data = self.ssl.read(2 ** 14)
-            else:
-                new_data = self.socket.recv(2 ** 14)
+            reader = self.ssl.read if self.ssl else self.socket.recv
+            new_data = reader(2 ** 14)
         except socket.error:
             # The server hung up.
             self.disconnect("Connection reset by peer")