From: Jeremy Stanley Date: Thu, 9 Nov 2017 09:58:38 +0000 (+0000) Subject: Handle connection reset in selftest X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;ds=sidebyside;h=b8e4ce13c1d87ce8005faac63328bc17104b0790;hp=5552af74173cb51760b0a52de8b93269f42f0455;p=mudpy.git Handle connection reset in selftest Within the selftest framework, catch ConnectionResetError exceptions and provide a clearer error. --- diff --git a/mudpy/tests/selftest.py b/mudpy/tests/selftest.py index 6239599..02d98a5 100644 --- a/mudpy/tests/selftest.py +++ b/mudpy/tests/selftest.py @@ -260,6 +260,10 @@ def main(): index, match, received = lusers[conversant].expect( [re.compile(question.encode("utf-8"), flags=re.DOTALL)], 5) captures[conversant] += received.decode("utf-8") + except ConnectionResetError: + print("ERROR: Unable to connect to server.") + success = False + break except EOFError: print("ERROR: luser%s premature disconnection expecting:\n\n" "%s\n\n"