def cleanup(self): if not self._closed: self._closed = True # Finally, close and reap the stream. # print "active" if ruv.isActive(self.stream) else "inactive" # print "closing" if ruv.isClosing(self.stream) else "not closing" if not ruv.isClosing(self.stream): ruv.closeAndFree(self.stream)
def cleanup(self): if not self._closed: self._closed = True # Release the drain. They should have released us as well. self._drain = None # Stop reading. ruv.readStop(self.stream) # And, finally, close and reap the stream. # print "active" if ruv.isActive(self.stream) else "inactive" # print "closing" if ruv.isClosing(self.stream) else "not closing" if not ruv.isClosing(self.stream): ruv.closeAndFree(self.stream)