Skip to content

Commit

Permalink
address flake8 and pep257 failures.
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya committed Jan 5, 2025
1 parent abebe44 commit 59000b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions rclpy/rclpy/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from enum import auto, StrEnum
import inspect
import sys
import threading
from typing import (Callable, cast, Coroutine, Dict, Generator, Generic, List,
Optional, TYPE_CHECKING, TypeVar, Union)
import warnings
import weakref
from enum import StrEnum, auto

if TYPE_CHECKING:
from rclpy.executors import Executor
Expand All @@ -33,7 +33,8 @@ def _fake_weakref() -> None:


class FutureState(StrEnum):
"""States defining the lifecycle of a future"""
"""States defining the lifecycle of a future."""

PENDING = auto()
CANCELLED = auto()
FINISHED = auto()
Expand Down Expand Up @@ -88,9 +89,9 @@ def cancelled(self) -> bool:

def done(self) -> bool:
"""
Indicate if the task has finished executing.
Indicate if the task has finished or cancelled executing.
:return: True if the task is finished or raised while it was executing
:return: True if the task is finished, cancelled or raised while it was executing
"""
return self._state != FutureState.PENDING

Expand Down
1 change: 0 additions & 1 deletion rclpy/test/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ def test_create_task_coroutine_cancel(self) -> None:
executor.add_node(self.node)

async def coroutine():
await asyncio.sleep(1)
return 'Sentinel Result'

future = executor.create_task(coroutine)
Expand Down

0 comments on commit 59000b6

Please sign in to comment.