From 36f7cd5f59d3960141fd134b23ae3dc454c67040 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Mon, 6 Mar 2023 13:45:24 +0000 Subject: [PATCH] Remove the import of Literal from entity.py. Literal is not supported in Python 3.6, which is what is in RHEL-8. Just remove this bit for now, since I don't actually believe it is needed anyway. Signed-off-by: Chris Lalancette --- launch/launch/frontend/entity.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/launch/launch/frontend/entity.py b/launch/launch/frontend/entity.py index 3816e6115..eedd3a2cc 100644 --- a/launch/launch/frontend/entity.py +++ b/launch/launch/frontend/entity.py @@ -15,7 +15,6 @@ """Module for Entity class.""" from typing import List -from typing import Literal from typing import Optional from typing import overload from typing import Text @@ -51,14 +50,9 @@ def children(self) -> List['Entity']: # - If no data type is passed, the return type is str. Similar to the above, it has two # possibilities: present or not present. # => 6 overloads to cover every combination - @overload - def get_attr(self, name: Text, *, data_type: Type[TargetType], - optional: Literal[False], can_be_str: bool = True) -> TargetType: - ... - @overload def get_attr(self, name: Text, *, data_type: Type[TargetType], # noqa: F811 - optional: Literal[True], can_be_str: bool = True) -> Optional[TargetType]: + optional: bool, can_be_str: bool = True) -> Optional[TargetType]: ... @overload @@ -67,12 +61,7 @@ def get_attr(self, name: Text, *, data_type: Type[TargetType], # noqa: F811 ... @overload - def get_attr(self, name: Text, *, optional: Literal[False], # noqa: F811 - can_be_str: bool = True) -> str: - ... - - @overload - def get_attr(self, name: Text, *, optional: Literal[True], # noqa: F811 + def get_attr(self, name: Text, *, optional: bool, # noqa: F811 can_be_str: bool = True) -> Optional[str]: ...