Skip to content

Commit 7842e2a

Browse files
committed
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.
1 parent 5c53958 commit 7842e2a

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

contrib/repute/repute.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ def report_GET(self, request, params, reporter, subject):
5757
res2 = res2[1][0]
5858
reputons['rate'] = res2[0]
5959

60-
defer.returnValue(
61-
{
62-
"application": "email-id",
63-
"reputons": [ reputons ]
64-
})
60+
return {
61+
"application": "email-id",
62+
"reputons": [ reputons ]
63+
}
6564

6665

6766
@defer.inlineCallbacks
@@ -83,7 +82,7 @@ def domain_reporter_GET(self, request, params, domain, reporter):
8382
ret = dict(itertools.izip(fields, rows[0]))
8483
else:
8584
ret = 0
86-
defer.returnValue(ret)
85+
return ret
8786

8887
@defer.inlineCallbacks
8988
def reporter_GET(self, request, params, reporter):
@@ -108,7 +107,7 @@ def reporter_GET(self, request, params, reporter):
108107
request.setHeader('Last-modified', rows[0][3].strftime("%A, %d, %B %Y %H:%M GMT"))
109108
else:
110109
ret = False
111-
defer.returnValue(ret)
110+
return ret
112111

113112
DKIM_APIDef = {
114113
"metadata": {"versions": [1]},

0 commit comments

Comments
 (0)