Commits

Jacob Söndergaard committed e3d3117

only try to callback on close, when a callback is given

Comments (0)

Files changed (1)

beanstalkt/beanstalkt.py

             self._stream.set_close_callback(callback)
         if self.closed():
             # already closed
-            callback()
+            if callback:
+                callback()
         else:
             self._stream.write(b'quit\r\n', self._stream.close)