Skip to content

Commit f891ccd

Browse files
committed
re: #275 fixed python 3.9 compatibility
1 parent 3cded8f commit f891ccd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/watchdog/observers/inotify_move_event_grouper.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
from __future__ import annotations
1010

1111
import logging
12-
from typing import TypeAlias, NamedTuple
12+
from typing import TYPE_CHECKING, NamedTuple, Union
1313

1414
from watchdog.observers.inotify_c import InotifyEvent
1515
from watchdog.utils.delayed_queue import DelayedQueue
1616

17+
if TYPE_CHECKING:
18+
from typing import TypeAlias
19+
1720
logger = logging.getLogger(__name__)
1821

1922

@@ -23,7 +26,7 @@ class PathedInotifyEvent(NamedTuple):
2326
path: bytes
2427

2528

26-
GroupedInotifyEvent: TypeAlias = PathedInotifyEvent | tuple[PathedInotifyEvent, PathedInotifyEvent]
29+
GroupedInotifyEvent: TypeAlias = Union[PathedInotifyEvent | tuple[PathedInotifyEvent, PathedInotifyEvent]]
2730

2831

2932
class InotifyMoveEventGrouper:

0 commit comments

Comments
 (0)