Skip to content

Commit

Permalink
don't clobber factory (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
meejah committed Apr 1, 2021
1 parent 8286a99 commit fd5530c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autobahn/twisted/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ def open(self, transport_config, options, protocol_class=None):
client_address = IPv4Address('TCP', '127.0.0.1', 31337)

server_protocol = self._server_protocol()
server_protocol.factory = WebSocketServerFactory()
# the protocol could already have a factory
if getattr(server_protocol, "factory", None) is None:
server_protocol.factory = WebSocketServerFactory()

server_transport = iosim.FakeTransport(
server_protocol, isServer=True,
Expand Down

0 comments on commit fd5530c

Please sign in to comment.