|
1 | 1 | import sys
|
2 | 2 |
|
3 |
| -from .base_events import BaseEventLoop as BaseEventLoop |
4 |
| -from .coroutines import iscoroutine as iscoroutine, iscoroutinefunction as iscoroutinefunction |
5 |
| -from .events import ( |
6 |
| - AbstractEventLoop as AbstractEventLoop, |
7 |
| - AbstractEventLoopPolicy as AbstractEventLoopPolicy, |
8 |
| - AbstractServer as AbstractServer, |
9 |
| - Handle as Handle, |
10 |
| - TimerHandle as TimerHandle, |
11 |
| - _get_running_loop as _get_running_loop, |
12 |
| - _set_running_loop as _set_running_loop, |
13 |
| - get_child_watcher as get_child_watcher, |
14 |
| - get_event_loop as get_event_loop, |
15 |
| - get_event_loop_policy as get_event_loop_policy, |
16 |
| - new_event_loop as new_event_loop, |
17 |
| - set_child_watcher as set_child_watcher, |
18 |
| - set_event_loop as set_event_loop, |
19 |
| - set_event_loop_policy as set_event_loop_policy, |
20 |
| -) |
21 |
| -from .futures import Future as Future, isfuture as isfuture, wrap_future as wrap_future |
22 |
| -from .locks import ( |
23 |
| - BoundedSemaphore as BoundedSemaphore, |
24 |
| - Condition as Condition, |
25 |
| - Event as Event, |
26 |
| - Lock as Lock, |
27 |
| - Semaphore as Semaphore, |
28 |
| -) |
29 |
| -from .protocols import ( |
30 |
| - BaseProtocol as BaseProtocol, |
31 |
| - DatagramProtocol as DatagramProtocol, |
32 |
| - Protocol as Protocol, |
33 |
| - SubprocessProtocol as SubprocessProtocol, |
34 |
| -) |
35 |
| -from .queues import ( |
36 |
| - LifoQueue as LifoQueue, |
37 |
| - PriorityQueue as PriorityQueue, |
38 |
| - Queue as Queue, |
39 |
| - QueueEmpty as QueueEmpty, |
40 |
| - QueueFull as QueueFull, |
41 |
| -) |
42 |
| -from .streams import ( |
43 |
| - StreamReader as StreamReader, |
44 |
| - StreamReaderProtocol as StreamReaderProtocol, |
45 |
| - StreamWriter as StreamWriter, |
46 |
| - open_connection as open_connection, |
47 |
| - start_server as start_server, |
48 |
| -) |
49 |
| -from .subprocess import create_subprocess_exec as create_subprocess_exec, create_subprocess_shell as create_subprocess_shell |
50 |
| -from .tasks import ( |
51 |
| - ALL_COMPLETED as ALL_COMPLETED, |
52 |
| - FIRST_COMPLETED as FIRST_COMPLETED, |
53 |
| - FIRST_EXCEPTION as FIRST_EXCEPTION, |
54 |
| - Task as Task, |
55 |
| - as_completed as as_completed, |
56 |
| - ensure_future as ensure_future, |
57 |
| - gather as gather, |
58 |
| - run_coroutine_threadsafe as run_coroutine_threadsafe, |
59 |
| - shield as shield, |
60 |
| - sleep as sleep, |
61 |
| - wait as wait, |
62 |
| - wait_for as wait_for, |
63 |
| -) |
64 |
| -from .transports import ( |
65 |
| - BaseTransport as BaseTransport, |
66 |
| - DatagramTransport as DatagramTransport, |
67 |
| - ReadTransport as ReadTransport, |
68 |
| - SubprocessTransport as SubprocessTransport, |
69 |
| - Transport as Transport, |
70 |
| - WriteTransport as WriteTransport, |
71 |
| -) |
| 3 | +# As at runtime, this depends on all submodules defining __all__ accurately. |
| 4 | +from .base_events import * |
| 5 | +from .coroutines import * |
| 6 | +from .events import * |
| 7 | +from .futures import * |
| 8 | +from .locks import * |
| 9 | +from .protocols import * |
| 10 | +from .queues import * |
| 11 | +from .streams import * |
| 12 | +from .subprocess import * |
| 13 | +from .tasks import * |
| 14 | +from .transports import * |
72 | 15 |
|
73 |
| -if sys.version_info < (3, 11): |
74 |
| - from .coroutines import coroutine as coroutine |
75 |
| - |
76 |
| -if sys.version_info >= (3, 9): |
77 |
| - from .threads import to_thread as to_thread |
78 |
| - |
79 |
| -if sys.version_info >= (3, 8): |
80 |
| - from .exceptions import ( |
81 |
| - CancelledError as CancelledError, |
82 |
| - IncompleteReadError as IncompleteReadError, |
83 |
| - InvalidStateError as InvalidStateError, |
84 |
| - LimitOverrunError as LimitOverrunError, |
85 |
| - TimeoutError as TimeoutError, |
86 |
| - ) |
87 |
| -else: |
88 |
| - from .futures import CancelledError as CancelledError, InvalidStateError as InvalidStateError, TimeoutError as TimeoutError |
89 |
| - from .streams import IncompleteReadError as IncompleteReadError, LimitOverrunError as LimitOverrunError |
| 16 | +if sys.version_info >= (3, 7): |
| 17 | + from .runners import * |
90 | 18 |
|
91 | 19 | if sys.version_info >= (3, 8):
|
92 |
| - from .exceptions import SendfileNotAvailableError as SendfileNotAvailableError |
93 |
| -elif sys.version_info >= (3, 7): |
94 |
| - from .events import SendfileNotAvailableError as SendfileNotAvailableError |
| 20 | + from .exceptions import * |
95 | 21 |
|
96 |
| -if sys.version_info >= (3, 7): |
97 |
| - from .events import get_running_loop as get_running_loop |
98 |
| - from .protocols import BufferedProtocol as BufferedProtocol |
99 |
| - from .runners import run as run |
100 |
| - from .tasks import ( |
101 |
| - _enter_task as _enter_task, |
102 |
| - _leave_task as _leave_task, |
103 |
| - _register_task as _register_task, |
104 |
| - _unregister_task as _unregister_task, |
105 |
| - all_tasks as all_tasks, |
106 |
| - create_task as create_task, |
107 |
| - current_task as current_task, |
108 |
| - ) |
| 22 | +if sys.version_info >= (3, 9): |
| 23 | + from .threads import * |
109 | 24 |
|
110 | 25 | if sys.version_info >= (3, 11):
|
111 |
| - from .taskgroups import TaskGroup as TaskGroup |
112 |
| - |
113 |
| -DefaultEventLoopPolicy: type[AbstractEventLoopPolicy] |
| 26 | + from .taskgroups import * |
114 | 27 |
|
115 | 28 | if sys.platform == "win32":
|
116 | 29 | from .windows_events import *
|
117 | 30 | else:
|
118 |
| - from .streams import open_unix_connection as open_unix_connection, start_unix_server as start_unix_server |
119 |
| - from .unix_events import ( |
120 |
| - AbstractChildWatcher as AbstractChildWatcher, |
121 |
| - FastChildWatcher as FastChildWatcher, |
122 |
| - SafeChildWatcher as SafeChildWatcher, |
123 |
| - SelectorEventLoop as SelectorEventLoop, |
124 |
| - ) |
125 |
| - |
126 |
| - if sys.version_info >= (3, 8): |
127 |
| - from .unix_events import MultiLoopChildWatcher as MultiLoopChildWatcher, ThreadedChildWatcher as ThreadedChildWatcher |
| 31 | + from .unix_events import * |
0 commit comments