From 3bce11cbbdfa1ea498b8fcaddce5c1adb3a2e32f Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 21 Nov 2010 17:14:19 +0000 Subject: [PATCH] Make test_nntplib more robust --- Lib/test/test_nntplib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index 13bb5059d59..a387f61f1e5 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -227,8 +227,10 @@ class NetworkedNNTPTestsMixin: def test_zzquit(self): # This test must be called last, hence the name cls = type(self) - self.server.quit() - cls.server = None + try: + self.server.quit() + finally: + cls.server = None @classmethod def wrap_methods(cls):