Skip to content

Fix type hint for threads #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pympipool/shared/executorbase.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import threading
from typing import Optional
from concurrent.futures import (
Executor as FutureExecutor,
Expand All @@ -12,6 +11,7 @@
import cloudpickle

from pympipool.shared.communication import interface_bootup
from pympipool.shared.thread import RaisingThread


class ExecutorBase(FutureExecutor):
Expand Down Expand Up @@ -76,7 +76,7 @@ def shutdown(self, wait: bool = True, *, cancel_futures: bool = False):
self._process = None
self._future_queue = None

def _set_process(self, process: threading.Thread):
def _set_process(self, process: RaisingThread):
self._process = process
self._process.start()

Expand All @@ -89,7 +89,7 @@ def __del__(self):
except (AttributeError, RuntimeError):
pass

def _set_process(self, process: threading.Thread):
def _set_process(self, process: RaisingThread):
self._process = process
self._process.start()

Expand Down Expand Up @@ -121,7 +121,7 @@ def shutdown(self, wait: bool = True, *, cancel_futures: bool = False):
self._process = None
self._future_queue = None

def _set_process(self, process: threading.Thread):
def _set_process(self, process: RaisingThread):
self._process = process
for process in self._process:
process.start()
Expand Down