Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: pypy #350

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ python:
- 3.7
- 3.6
- 3.5
- pypy3.5

matrix:
include:
Expand Down
13 changes: 8 additions & 5 deletions osbrain/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,11 @@ def _loopback_reqrep(self, socket, data_to_send):
try:
loopback.connect(socket)
loopback.send_pyobj(data_to_send)
return loopback.recv_pyobj()
except zmq.error.ContextTerminated:
pass
finally:
received = loopback.recv_pyobj()
loopback.close(linger=0)
except zmq.error.ContextTerminated:
return None
return received

def _loopback(self, header, data=None):
"""
Expand Down Expand Up @@ -1872,7 +1872,10 @@ def _close_socket(self, socket, linger):
self._poller.unregister(socket)

linger = get_linger(linger)
socket.close(linger=linger)
try:
socket.close(linger=linger)
except zmq.error.ContextTerminated:
pass
address = self._address[socket]
if address.transport == 'ipc':
self._cleanup_ipc_socket_files(address)
Expand Down
3 changes: 2 additions & 1 deletion osbrain/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def locate_ns(nsaddr, timeout=3.0):
time0 = time.time()
while True:
try:
Pyro4.locateNS(host, port)
ns = Pyro4.locateNS(host, port)
ns._pyroRelease()
return nsaddr
except NamingError:
if time.time() - time0 < timeout:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
keywords='osbrain multi-agent system',
packages=['osbrain'],
install_requires=[
'pathlib',
'Pyro4>=4.48',
'pyzmq>=15.2.0',
'dill>=0.2.0,!=0.2.7',
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ envlist =
py37
py36
py35
pypy3
lint
docs

Expand Down