Skip to content

Commit

Permalink
Merge pull request #54 from magic-wormhole/remove-twisted-defer-retur…
Browse files Browse the repository at this point in the history
…n-value

Remove twisted defer return value
  • Loading branch information
meejah authored Dec 10, 2024
2 parents b1c2133 + d847699 commit d9a514f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/wormhole_mailbox_server/test/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import treq
from twisted.trial import unittest
from twisted.internet import defer, reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.defer import inlineCallbacks
from ..web import make_web_server
from ..server import SidedMessage
from ..database import create_or_upgrade_usage_db
Expand Down Expand Up @@ -38,7 +38,7 @@ def make_client(self):
reactor.connectTCP("127.0.0.1", self.rdv_ws_port, f)
c = yield f.d
self._clients.append(c)
returnValue(c)
return c

@inlineCallbacks
def test_log_http(self):
Expand Down Expand Up @@ -108,7 +108,7 @@ def make_client(self):
reactor.connectTCP("127.0.0.1", self.rdv_ws_port, f)
c = yield f.d
self._clients.append(c)
returnValue(c)
return c

def check_welcome(self, data):
self.failUnlessIn("welcome", data)
Expand Down
6 changes: 3 additions & 3 deletions src/wormhole_mailbox_server/test/ws_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function, unicode_literals
import json, itertools
from twisted.internet import defer
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted import websocket

class WSClient(websocket.WebSocketClientProtocol):
Expand Down Expand Up @@ -49,7 +49,7 @@ def next_non_ack(self):
print("unexpected onClose", m)
raise AssertionError("unexpected onClose")
if m["type"] != "ack":
returnValue(m)
return m

def strip_acks(self):
self.events = [e for e in self.events if e["type"] != "ack"]
Expand All @@ -73,7 +73,7 @@ def sync(self):
ev = yield self.next_event()
if ev["type"] == "pong" and ev["pong"] == ping:
self.events = old_events + self.events
returnValue(None)
return None
old_events.append(ev)

class WSFactory(websocket.WebSocketClientFactory):
Expand Down

0 comments on commit d9a514f

Please sign in to comment.