Skip to content

Commit

Permalink
Fix for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Oct 3, 2023
1 parent 769e609 commit 5925cc7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions reportportal_client/aio/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class Task(Generic[_T], asyncio.Task, metaclass=AbstractBaseClass):

__metaclass__ = AbstractBaseClass

name: Optional[str]

def __init__(
self,
coro: Union[Generator[Future, None, _T], Awaitable[_T]],
Expand All @@ -53,7 +55,11 @@ def __init__(
:param loop: Event Loop which will be used to execute the Task
:param name: the name of the task
"""
super().__init__(coro, loop=loop, name=name)
self.name = name
if sys.version_info < (3, 8):
super().__init__(coro, loop=loop)
else:
super().__init__(coro, loop=loop, name=name)

@abstractmethod
def blocking_result(self) -> _T:
Expand Down Expand Up @@ -100,10 +106,7 @@ def __init__(
:param loop: Event Loop which will be used to execute the Task
:param name: the name of the task
"""
if sys.version_info < (3, 8):
super().__init__(coro, loop=loop)
else:
super().__init__(coro, loop=loop, name=name)
super().__init__(coro, loop=loop, name=name)
self.__loop = loop

def blocking_result(self) -> _T:
Expand Down Expand Up @@ -136,10 +139,7 @@ def __init__(
:param loop: Event Loop which will be used to execute the Task
:param name: the name of the task
"""
if sys.version_info < (3, 8):
super().__init__(coro, loop=loop)
else:
super().__init__(coro, loop=loop, name=name)
super().__init__(coro, loop=loop, name=name)
self.__loop = loop
self.__wait_timeout = wait_timeout

Expand Down

0 comments on commit 5925cc7

Please sign in to comment.