more typing work
This commit is contained in:
parent
ce94a9b2df
commit
2d4f194f0d
@ -13,8 +13,7 @@ import sys
|
|||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from typing import (
|
from typing import (
|
||||||
TYPE_CHECKING, Any, Callable, Dict, Generator, List, NamedTuple, Optional,
|
TYPE_CHECKING, Any, Callable, Dict, Generator, List, NamedTuple, Optional
|
||||||
Protocol
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from kitty.constants import is_macos
|
from kitty.constants import is_macos
|
||||||
@ -34,6 +33,10 @@ if TYPE_CHECKING:
|
|||||||
from kitty.key_encoding import KeyEvent
|
from kitty.key_encoding import KeyEvent
|
||||||
from .images import ImageManager
|
from .images import ImageManager
|
||||||
KeyEvent, ImageManager
|
KeyEvent, ImageManager
|
||||||
|
from typing import Protocol
|
||||||
|
else:
|
||||||
|
Protocol = object
|
||||||
|
|
||||||
|
|
||||||
C, D = K['C'], K['D']
|
C, D = K['C'], K['D']
|
||||||
|
|
||||||
@ -195,7 +198,7 @@ class Loop:
|
|||||||
if is_macos:
|
if is_macos:
|
||||||
# On macOS PTY devices are not supported by the KqueueSelector and
|
# On macOS PTY devices are not supported by the KqueueSelector and
|
||||||
# the PollSelector is broken, causes 100% CPU usage
|
# the PollSelector is broken, causes 100% CPU usage
|
||||||
self.asycio_loop = asyncio.SelectorEventLoop(selectors.SelectSelector()) # type: ignore
|
self.asycio_loop: asyncio.AbstractEventLoop = asyncio.SelectorEventLoop(selectors.SelectSelector())
|
||||||
asyncio.set_event_loop(self.asycio_loop)
|
asyncio.set_event_loop(self.asycio_loop)
|
||||||
else:
|
else:
|
||||||
self.asycio_loop = asyncio.get_event_loop()
|
self.asycio_loop = asyncio.get_event_loop()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user