-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle re-exporting of platform-specific hazmat functions
- Loading branch information
Showing
3 changed files
with
43 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,46 @@ | ||
# These are all re-exported from trio._core. See comments in trio/__init__.py | ||
# for details. | ||
# for details. To make static analysis easier, this lists all possible | ||
# symbols, and then we prune some below if they aren't available on this | ||
# system. | ||
__all__ = [ | ||
"Result", "Value", "Error", "cancel_shielded_checkpoint", "Abort", | ||
"wait_task_rescheduled", "enable_ki_protection", "disable_ki_protection", | ||
"currently_ki_protected", "Task", "checkpoint", "current_task", | ||
"checkpoint_if_cancelled", "spawn_system_task", "reschedule", | ||
"current_call_soon_thread_and_signal_safe", "wait_writable", | ||
"wait_readable", "ParkingLot", "UnboundedQueue", "RunLocal", | ||
"wait_socket_readable", "wait_socket_writable" | ||
"Result", | ||
"Value", | ||
"Error", | ||
"cancel_shielded_checkpoint", | ||
"Abort", | ||
"wait_task_rescheduled", | ||
"enable_ki_protection", | ||
"disable_ki_protection", | ||
"currently_ki_protected", | ||
"Task", | ||
"checkpoint", | ||
"current_task", | ||
"checkpoint_if_cancelled", | ||
"spawn_system_task", | ||
"reschedule", | ||
"current_call_soon_thread_and_signal_safe", | ||
"wait_writable", | ||
"wait_readable", | ||
"ParkingLot", | ||
"UnboundedQueue", | ||
"RunLocal", | ||
"wait_socket_readable", | ||
"wait_socket_writable", | ||
# kqueue symbols | ||
"current_kqueue", | ||
"monitor_kevent", | ||
"wait_kevent", | ||
# windows symbols | ||
"current_iocp", | ||
"register_with_iocp", | ||
"wait_overlapped", | ||
"monitor_completion_key", | ||
] | ||
|
||
from . import _core | ||
globals().update({sym: getattr(_core, sym) for sym in __all__}) | ||
# Some hazmat symbols are platform specific | ||
for _sym in list(__all__): | ||
if hasattr(_core, _sym): | ||
globals()[_sym] = getattr(_core, _sym) | ||
else: | ||
__all__.remove(_sym) |