From 7842e2a29098e45fbd11fc3daf1268a2b5c67f06 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Tue, 10 Dec 2024 20:30:20 +0200 Subject: [PATCH] Remove uses of twisted.internet.defer.returnValue returnValue() can be replaced with plain return in Python 3 code. returnValue() has been deprecated in Twisted 24.7.0 and will be removed soon. --- contrib/repute/repute.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/contrib/repute/repute.py b/contrib/repute/repute.py index 22afc7d8..10208625 100644 --- a/contrib/repute/repute.py +++ b/contrib/repute/repute.py @@ -57,11 +57,10 @@ def report_GET(self, request, params, reporter, subject): res2 = res2[1][0] reputons['rate'] = res2[0] - defer.returnValue( - { - "application": "email-id", - "reputons": [ reputons ] - }) + return { + "application": "email-id", + "reputons": [ reputons ] + } @defer.inlineCallbacks @@ -83,7 +82,7 @@ def domain_reporter_GET(self, request, params, domain, reporter): ret = dict(itertools.izip(fields, rows[0])) else: ret = 0 - defer.returnValue(ret) + return ret @defer.inlineCallbacks def reporter_GET(self, request, params, reporter): @@ -108,7 +107,7 @@ def reporter_GET(self, request, params, reporter): request.setHeader('Last-modified', rows[0][3].strftime("%A, %d, %B %Y %H:%M GMT")) else: ret = False - defer.returnValue(ret) + return ret DKIM_APIDef = { "metadata": {"versions": [1]},