maldil / JavaFyPy

adapting Java AST mining tools to Python
2 stars 1 forks source link

While with else #11

Open maldil opened 3 years ago

maldil commented 3 years ago

            while self._rcvd_idx < self._send_idx:
                info = self._task_info[self._rcvd_idx]
                worker_id = info[0]
                if len(info) == 2 or self._workers_status[worker_id]:  # has data or is still active
                    break
                del self._task_info[self._rcvd_idx]
                self._rcvd_idx += 1
            else:
                # no valid `self._rcvd_idx` is found (i.e., didn't break)
                if not self._persistent_workers:
                    self._shutdown_workers()
                raise StopIteration```
maldil commented 3 years ago

TestPyTorch - file1328 ()