Skip to content

Commit

Permalink
frame: fix AttributeError on python 3.5+
Browse files Browse the repository at this point in the history
Protocol.reader in Python3.5 is set to None by the connection_lost
method.  Occasionally, this leads to endless exception throws.  This fix
may close issue #115.
  • Loading branch information
pvgorbunov authored and RemiCardona committed Jul 10, 2017
1 parent b1b9011 commit cbb1379
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aioamqp/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ def __init__(self, reader):
@asyncio.coroutine
def read_frame(self):
"""Decode the frame"""
if not self.reader:
raise exceptions.AmqpClosedConnection()
try:
data = yield from self.reader.readexactly(7)
except (asyncio.IncompleteReadError, socket.error) as ex:
Expand Down

1 comment on commit cbb1379

@nwpierce
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Any chance this could make it into a release sometime soon? I think this issue has been biting us.

Thanks!

Please sign in to comment.