Skip to content

Commit

Permalink
Use HasFileno from typeshed
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Nov 18, 2024
1 parent e21f323 commit a379ccf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/anyio/_backends/_selector_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import threading
import typing
from typing import (
TYPE_CHECKING,
Any,
Callable,
Union,
Expand All @@ -22,14 +23,10 @@

from ._asyncio import find_root_task

if typing.TYPE_CHECKING:
from typing_extensions import Protocol
if TYPE_CHECKING:
from _typeshed import HasFileno

class _HasFileno(Protocol):
def fileno(self) -> int:
pass

_FileDescriptorLike = Union[int, _HasFileno]
_FileDescriptorLike = HasFileno | int


# registry of asyncio loop : selector thread
Expand Down

0 comments on commit a379ccf

Please sign in to comment.