Skip to content

Commit

Permalink
process_comms.py / process_states.py
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 27, 2024
1 parent dacf8a9 commit 6b31928
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/plumpy/persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def delete_process_checkpoints(self, pid: PID_TYPE) -> None:
del self._checkpoints[pid]


SavableClsType = TypeVar('SavableClsType', bound='Type[Savable]') # type: ignore[name-defined] # pylint: disable=invalid-name
SavableClsType = TypeVar('SavableClsType', bound='type[Savable]')


def auto_persist(*members: str) -> Callable[[SavableClsType], SavableClsType]:
Expand Down
6 changes: 4 additions & 2 deletions src/plumpy/process_comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ async def _launch(
self._persister.save_checkpoint(proc)

if nowait:
asyncio.ensure_future(proc.step_until_terminated())
# XXX: can return a reference and gracefully use task to cancel itself when the upper call stack fails
asyncio.ensure_future(proc.step_until_terminated()) # noqa: RUF006
return proc.pid

await proc.step_until_terminated()
Expand All @@ -594,7 +595,8 @@ async def _continue(
proc = cast('Process', saved_state.unbundle(self._load_context))

if nowait:
asyncio.ensure_future(proc.step_until_terminated())
# XXX: can return a reference and gracefully use task to cancel itself when the upper call stack fails
asyncio.ensure_future(proc.step_until_terminated()) # noqa: RUF006
return proc.pid

await proc.step_until_terminated()
Expand Down
2 changes: 1 addition & 1 deletion src/plumpy/process_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from .processes import Process # pylint: disable=cyclic-import


class Interruption(Exception):
class Interruption(Exception): # noqa: N818
pass


Expand Down

0 comments on commit 6b31928

Please sign in to comment.