veegee / amqpy

Pure-Python 2 & 3 AMQP client library
http://amqpy.readthedocs.org/
Other
32 stars 5 forks source link

Connection.connect() can't be reused #23

Closed gst closed 9 years ago

gst commented 9 years ago
>>> con = amqpy.Connection()
>>> con.close()
>>> con.connect()
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    con.connect()
  File "/home/gstarck/work/public/python/amqpy/amqpy/connection.py", line 151, in connect
    self.wait(spec.Connection.Start)
  File "/home/gstarck/work/public/python/amqpy/amqpy/abstract_channel.py", line 67, in wait
    m = self._wait_method([method])
  File "/home/gstarck/work/public/python/amqpy/amqpy/abstract_channel.py", line 104, in _wait_method
    method = self.connection.method_reader.read_method()
AttributeError: 'NoneType' object has no attribute 'method_reader'
>>> 

should be corrected, I guess, it's all because of:

AbstractChannel.init, called from Connection.init ; but in the close() process, the Connection.connection attribute is reset to None.. when you call Connection.connect() then this attribute should also be reset correctly somehow ..