X-Git-Url: https://mudpy.org/gitweb?a=blobdiff_plain;f=lib%2Fmudpy%2Fmisc.py;h=7e8e612216c69077ce2a3818cf157189488486d9;hb=835a5824f9313c9154388e0074bcfcb8b2a97a2e;hp=42d14c8a10a5e611fb9370ab4945bf15eadb14b5;hpb=0a25cf895fa70fedf64131d284cfff19251b3d46;p=mudpy.git diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index 42d14c8..7e8e612 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -893,14 +893,13 @@ class User: try: self.connection.send(self.output_queue[0]) del self.output_queue[0] - except: + except BrokenPipeError: if self.account and self.account.get("name"): account = self.account.get("name") else: account = "an unknown user" - log("Sending to %s raised an exception (broken pipe?)." - % account, 7) - pass + log("Broken pipe sending to %s." % account, 7) + self.state = "disconnecting" def enqueue_input(self): """Process and enqueue any new input.""" @@ -908,7 +907,7 @@ class User: # check for some input try: raw_input = self.connection.recv(1024) - except: + except (BlockingIOError, OSError): raw_input = b"" # we got something @@ -1490,7 +1489,7 @@ def check_for_connection(listening_socket): # try to accept a new connection try: connection, address = listening_socket.accept() - except: + except BlockingIOError: return None # note that we got one