From: Jeremy Stanley Date: Wed, 8 Jan 2020 23:29:54 +0000 (+0000) Subject: Collapse redundant exceptions X-Git-Tag: 0.2.0~12 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=f63fc5f987aedcfcee80c84cde66fee6831aff23;p=mudpy.git Collapse redundant exceptions In User.enqueue_input() combine a redundant match on BlockingIOError and OSError since the former is a subclass of the latter. This was caught by the B014 check introduced in flake8-bugbear 20.1.1. --- diff --git a/mudpy/misc.py b/mudpy/misc.py index ecab471..d753559 100644 --- a/mudpy/misc.py +++ b/mudpy/misc.py @@ -1,6 +1,6 @@ """Miscellaneous functions for the mudpy engine.""" -# Copyright (c) 2004-2019 mudpy authors. Permission to use, copy, +# Copyright (c) 2004-2020 mudpy authors. Permission to use, copy, # modify, and distribute this software is granted under terms # provided in the LICENSE file distributed with this software. @@ -850,7 +850,7 @@ class User: # check for some input try: raw_input = self.connection.recv(1024) - except (BlockingIOError, OSError): + except OSError: raw_input = b"" # we got something