We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f090fb commit 930f3ffCopy full SHA for 930f3ff
pigwig/reloader_linux.py
@@ -1,6 +1,11 @@
1
from __future__ import annotations
2
3
-import _thread # noqa: F401
+try:
4
+ import eventlet
5
+except ImportError:
6
+ import _thread
7
+else:
8
+ _thread = eventlet.patcher.original('_thread')
9
import os
10
import sys
11
import typing
@@ -20,12 +25,6 @@ def init() -> None:
20
25
wd = inotify.add_watch(fd, pathname, inotify.IN.CLOSE_WRITE)
21
26
wds[wd] = pathname
22
27
23
- try:
24
- import eventlet
- except ImportError:
- pass
- else:
28
- _thread = eventlet.patcher.original('_thread')
29
_thread.start_new_thread(_reloader, (fd, wds))
30
31
def _reloader(fd: int, wds: dict[int, str]) -> typing.NoReturn:
0 commit comments