From 4d99a2594947931eb851bc1621561816410eea12 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 10 Dec 2024 00:17:48 +0000 Subject: [PATCH] Stop using twisted.internet.defer.returnValue `defer.returnValue` was only needed in Python 2; in Python 3, a simple `return` is fine. `twisted.internet.defer.returnValue` is deprecated as of Twisted 24.7.0. --- testtools/twistedsupport/_runtest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testtools/twistedsupport/_runtest.py b/testtools/twistedsupport/_runtest.py index 9992c53b..a343e68a 100644 --- a/testtools/twistedsupport/_runtest.py +++ b/testtools/twistedsupport/_runtest.py @@ -335,7 +335,7 @@ def _run_cleanups(self): exc_info = sys.exc_info() self.case._report_traceback(exc_info) last_exception = exc_info[1] - defer.returnValue(last_exception) + return last_exception def _make_spinner(self): """Make the `Spinner` to be used to run the tests."""