Fixed -- Removed unneeded hasattr() check in LiveServerTestCase._tearDownClassInternal().
@@ -1563,12 +1563,8 @@ class LiveServerTestCase(TransactionTestCase):
@classmethod
def _tearDownClassInternal(cls):
- # There may not be a 'server_thread' attribute if setUpClass() for some
- # reasons has raised an exception.
- if hasattr(cls, 'server_thread'):
- # Terminate the live server's thread
+ # Terminate the live server's thread.
cls.server_thread.terminate()
-
# Restore sqlite in-memory database connections' non-shareability.
for conn in cls.server_thread.connections_override.values():
conn.dec_thread_sharing()
