Skip to content

Commit

Permalink
amend round
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Dec 11, 2024
1 parent f7427e0 commit 1997185
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
8 changes: 0 additions & 8 deletions src/plumpy/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# -*- coding: utf-8 -*-
from typing import Optional

from aio_pika.exceptions import ChannelInvalidStateError, ConnectionClosed

__all__ = [
'ClosedError',
'CommunicatorChannelInvalidStateError',
'CommunicatorConnectionClosed',
'InvalidStateError',
'KilledError',
'PersistenceError',
Expand Down Expand Up @@ -43,7 +39,3 @@ class PersistenceError(Exception):
class ClosedError(Exception):
"""Raised when an mutable operation is attempted on a closed process"""


# Alias aio_pika
CommunicatorConnectionClosed = ConnectionClosed
CommunicatorChannelInvalidStateError = ChannelInvalidStateError
2 changes: 1 addition & 1 deletion src/plumpy/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def on_entering(self, state: process_states.State) -> None:
call_with_super_check(self.on_except, state.get_exc_info()) # type: ignore

def on_entered(self, from_state: Optional[process_states.State]) -> None:
from plumpy.exceptions import CommunicatorChannelInvalidStateError, CommunicatorConnectionClosed
from plumpy.rmq.exceptions import CommunicatorChannelInvalidStateError, CommunicatorConnectionClosed

# Map these onto direct functions that the subclass can implement
state_label = self._state.LABEL
Expand Down
4 changes: 4 additions & 0 deletions src/plumpy/rmq/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from .exceptions import *

__all__ = exceptions.__all__
11 changes: 11 additions & 0 deletions src/plumpy/rmq/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
from aio_pika.exceptions import ChannelInvalidStateError, ConnectionClosed

__all__ = [
'CommunicatorChannelInvalidStateError',
'CommunicatorConnectionClosed',
]

# Alias aio_pika
CommunicatorConnectionClosed = ConnectionClosed
CommunicatorChannelInvalidStateError = ChannelInvalidStateError

0 comments on commit 1997185

Please sign in to comment.