def safe_close_queue(self, name, queue):
        self.debug("Closing queue {0}", name)
        queue.close()
        try:
            self.debug("Joining thread for queue {0}", name)

            try:
                self.debug(
                    "Joining queue {name} (size {size}, full: {full})",
                    name=name,
                    size=queue.qsize(),
                    full=queue.full())
            except NotImplementedError:
                pass  # Mac OS X doesn't implement qsize()
            queue.join_thread()
        # threads might have already been closed
        except __HOLE__ as e:
            self.debug("Couldn't join queue {0}; error {1}", name, e)
        else:
            self.debug("Done closing {0}, no exceptions.", name)
dataset/ETHPy150Open gatoatigrado/vimap/vimap/real_worker_routine.py/WorkerRoutine.safe_close_queue