|
13 | 13 |
|
14 | 14 | import array |
15 | 15 | import warnings |
16 | | -from typing import Callable, Optional |
| 16 | +from typing import Any, Callable, Optional, TypeAlias |
17 | 17 | from ctypes import * |
18 | 18 |
|
19 | 19 | # Import all the raw bindings |
20 | 20 | from . import webui_bindings as _raw |
21 | 21 |
|
22 | 22 |
|
23 | | - |
24 | 23 | # C function type for the file handler window |
25 | 24 | filehandler_window_callback = CFUNCTYPE(c_void_p, c_size_t, c_char_p, POINTER(c_int)) |
26 | 25 |
|
@@ -325,7 +324,7 @@ def script_client(self, script: str, timeout: int = 0, buffer_size: int = 4096) |
325 | 324 | # Initializing Result |
326 | 325 | res = JavaScript() |
327 | 326 |
|
328 | | - res.data = buffer.value.decode('utf-8', errors='ignore') |
| 327 | + res.data = buffer.value.decode('utf-8', errors='ignore') # type: ignore |
329 | 328 | res.error = not success |
330 | 329 | return res |
331 | 330 |
|
@@ -636,8 +635,8 @@ def __init__(self, window_id: Optional[int] = None): |
636 | 635 | self._cb_func_list: dict = {} |
637 | 636 |
|
638 | 637 | # gets used for both filehandler and filehandler_window, should wipe out the other just how it does in C |
639 | | - self._file_handler_cb: _raw.FILE_HANDLER_CB = None |
640 | | - self._buffers = [] |
| 638 | + self._file_handler_cb: Any = None |
| 639 | + self._buffers: list = [] |
641 | 640 |
|
642 | 641 | # -- dispatcher for function bindings ----------- |
643 | 642 | def _make_dispatcher(self): |
@@ -1431,7 +1430,7 @@ def script(self, script: str, timeout: int = 0, buffer_size: int = 4096) -> Java |
1431 | 1430 | # Initializing Result |
1432 | 1431 | res = JavaScript() |
1433 | 1432 |
|
1434 | | - res.data = buffer.value.decode('utf-8', errors='ignore') |
| 1433 | + res.data = buffer.value.decode('utf-8', errors='ignore') # type: ignore |
1435 | 1434 | res.error = not success |
1436 | 1435 | return res |
1437 | 1436 |
|
|
0 commit comments