From 22a72bec37c3a569f319dbd3bd72676f380d480b Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 9 Nov 2017 05:29:24 +0000 Subject: [PATCH] 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. --- mudpy/tests/selftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.11.0