From: Jeremy Stanley Date: Thu, 9 Nov 2017 05:29:24 +0000 (+0000) Subject: Catch Exception when necessary X-Git-Tag: 0.0.1~126 X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=commitdiff_plain;h=22a72bec37c3a569f319dbd3bd72676f380d480b Catch Exception when necessary In situations where any exception needs to be matched in an except clause, specify the Exception base class so as to be explicit that it's an intentional choice and not an accidental omission. --- diff --git a/mudpy/tests/selftest.py b/mudpy/tests/selftest.py index 500356f..6239599 100644 --- a/mudpy/tests/selftest.py +++ b/mudpy/tests/selftest.py @@ -270,7 +270,7 @@ def main(): try: captures[conversant] += lusers[ conversant].read_very_eager().decode("utf-8") - except: + except Exception: pass if index is not 0: print("ERROR: luser%s did not receive expected string:\n\n" @@ -291,7 +291,7 @@ def main(): try: captures[conversant] += lusers[ conversant].read_very_eager().decode("utf-8") - except: + except Exception: pass lusers[conversant].close() logfile = "capture_%s.log" % conversant