Skip to content

Commit d04d91a

Browse files
committed
Fixing types for Python 3.7 compatibility.
1 parent 6a487e4 commit d04d91a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

c8y_tk/app/subscription_listener.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import logging
77
import threading
88
import time
9-
from typing import Callable, Union
9+
from typing import Callable, Union, List
1010

1111
from c8y_api.app import MultiTenantCumulocityApp
1212

@@ -29,7 +29,7 @@ class SubscriptionListener:
2929
def __init__(
3030
self,
3131
app: MultiTenantCumulocityApp,
32-
callback: Callable[[list[str]], None] = None,
32+
callback: Callable[[List[str]], None] = None,
3333
max_threads: int = 5,
3434
blocking: bool = True,
3535
polling_interval: float = 3600,
@@ -75,9 +75,9 @@ def _cleanup_future(self, future):
7575

7676
def add_callback(
7777
self,
78-
callback: Callable[[Union[str ,list[str]]], None],
78+
callback: Callable[[Union[str, List[str]]], None],
7979
blocking: bool = True,
80-
when: str = 'any',
80+
when: str = 'any'
8181
) -> "SubscriptionListener":
8282
"""Add a callback function to be invoked if a tenant subscribes
8383
to/unsubscribes from the monitored multi-tenant microservice.
@@ -262,7 +262,7 @@ def shutdown(self, timeout: float = None):
262262
self._executor and self.get_callbacks()):
263263
raise TimeoutError(f"Listener thread did not close within the specified timeout ({timeout}s).")
264264

265-
def get_callbacks(self) -> list[Future]:
265+
def get_callbacks(self) -> List[Future]:
266266
"""Get currently running callbacks.
267267
268268
This function can be used to gain direct access to the currently

0 commit comments

Comments
 (0)