Skip to content

Commit

Permalink
Merge pull request #139 from aio-libs/contextinstance
Browse files Browse the repository at this point in the history
don't call a classmethod on the instance
  • Loading branch information
JelleZijlstra committed Jun 16, 2018
2 parents 42bbd64 + 3692e4c commit 4b15ea3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aiozmq/cli/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def serve_proxy(options):
print("No backend socket address specified!", file=sys.stderr)
sys.exit(1)

ctx = zmq.Context().instance()
ctx = zmq.Context.instance()

front_type, back_type = options.sock_types

Expand Down
2 changes: 1 addition & 1 deletion aiozmq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def create_zmq_connection(protocol_factory, zmq_type, *,

try:
if zmq_sock is None:
zmq_sock = zmq.Context().instance().socket(zmq_type)
zmq_sock = zmq.Context.instance().socket(zmq_type)
elif zmq_sock.getsockopt(zmq.TYPE) != zmq_type:
raise ValueError('Invalid zmq_sock type')
except zmq.ZMQError as exc:
Expand Down
6 changes: 3 additions & 3 deletions tests/zmq_events_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def go():
self.loop.run_until_complete(go())

def test_zmq_socket(self):
zmq_sock = zmq.Context().instance().socket(zmq.PUB)
zmq_sock = zmq.Context.instance().socket(zmq.PUB)

@asyncio.coroutine
def connect():
Expand All @@ -279,7 +279,7 @@ def connect():
tr.close()

def test_zmq_socket_invalid_type(self):
zmq_sock = zmq.Context().instance().socket(zmq.PUB)
zmq_sock = zmq.Context.instance().socket(zmq.PUB)

@asyncio.coroutine
def connect():
Expand All @@ -296,7 +296,7 @@ def connect():
self.assertFalse(zmq_sock.closed)

def test_create_zmq_connection_ZMQError(self):
zmq_sock = zmq.Context().instance().socket(zmq.PUB)
zmq_sock = zmq.Context.instance().socket(zmq.PUB)
zmq_sock.close()

@asyncio.coroutine
Expand Down

0 comments on commit 4b15ea3

Please sign in to comment.