|
35 | 35 | from urllib.error import URLError
|
36 | 36 |
|
37 | 37 | from typing import Callable, Union, Any, List
|
38 |
| -# For Python less 3.11 compatibility |
39 |
| -try: |
40 |
| - from typing import Self # type: ignore |
41 |
| -except ImportError: |
42 |
| - from typing_extensions import Self |
43 | 38 |
|
44 | 39 | from .common import ModuleUtils
|
45 | 40 | from .logger import EmptyHandler, SensitiveFilter
|
@@ -74,7 +69,7 @@ def __getattr__(self, name: str) -> Callable:
|
74 | 69 | TypeError: Raises if gets unexpected arguments.
|
75 | 70 |
|
76 | 71 | Returns:
|
77 |
| - Self: Zabbix API method. |
| 72 | + Callable: Zabbix API method. |
78 | 73 | """
|
79 | 74 |
|
80 | 75 | # For compatibility with Python less 3.9 versions
|
@@ -256,13 +251,13 @@ def __getattr__(self, name: str) -> Callable:
|
256 | 251 |
|
257 | 252 | return APIObject(name, self)
|
258 | 253 |
|
259 |
| - def __enter__(self) -> Self: |
| 254 | + def __enter__(self) -> Callable: |
260 | 255 | return self
|
261 | 256 |
|
262 | 257 | def __exit__(self, *args) -> None:
|
263 | 258 | self.logout()
|
264 | 259 |
|
265 |
| - def __basic_auth(self, user: str, password: str) -> Self: |
| 260 | + def __basic_auth(self, user: str, password: str) -> None: |
266 | 261 | """Enable Basic Authentication using.
|
267 | 262 |
|
268 | 263 | Args:
|
@@ -302,7 +297,7 @@ def version(self) -> APIVersion:
|
302 | 297 | return self.api_version()
|
303 | 298 |
|
304 | 299 | def login(self, token: Union[str, None] = None, user: Union[str, None] = None,
|
305 |
| - password: Union[str, None] = None) -> Self: |
| 300 | + password: Union[str, None] = None) -> None: |
306 | 301 | """Login to Zabbix API.
|
307 | 302 |
|
308 | 303 | Args:
|
|
0 commit comments