diff options
author | schlamar <marc.schlaich@gmail.com> | 2014-01-07 16:14:06 +0100 |
---|---|---|
committer | schlamar <marc.schlaich@gmail.com> | 2014-01-07 16:14:06 +0100 |
commit | b2fea96e1c93586a5b8bf3ddf57405cf28dea337 (patch) | |
tree | 80c8531d1fe8a9749ff83c91610a6f15126fbd65 | |
parent | feb210e69dd6145daa4f7ed1e8ced77060fdb761 (diff) | |
download | trollius-b2fea96e1c93586a5b8bf3ddf57405cf28dea337.tar.gz |
Added more stuff to _winapi port.
-rw-r--r-- | asyncio/_winapi.py | 28 | ||||
-rw-r--r-- | tests/test_windows_events.py | 3 |
2 files changed, 27 insertions, 4 deletions
diff --git a/asyncio/_winapi.py b/asyncio/_winapi.py index c349c8d..e994143 100644 --- a/asyncio/_winapi.py +++ b/asyncio/_winapi.py @@ -1,8 +1,32 @@ -__all__ = ['CloseHandle'] +__all__ = [ + 'CloseHandle', 'CreateNamedPipe', + 'NULL', + 'PIPE_ACCESS_DUPLEX', 'PIPE_TYPE_MESSAGE', 'PIPE_READMODE_MESSAGE', + 'PIPE_WAIT', 'PIPE_UNLIMITED_INSTANCES', 'NMPWAIT_WAIT_FOREVER', + 'FILE_FLAG_OVERLAPPED', 'FILE_FLAG_FIRST_PIPE_INSTANCE', + ] try: - from _winapi import CloseHandle + from _winapi import ( + CloseHandle, CreateNamedPipe, + NULL, + PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE, PIPE_READMODE_MESSAGE, + PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, NMPWAIT_WAIT_FOREVER, + FILE_FLAG_OVERLAPPED, FILE_FLAG_FIRST_PIPE_INSTANCE, + ) except ImportError: from _multiprocessing import win32 CloseHandle = win32.CloseHandle + CreateNamedPipe = win32.CreateNamedPipe + NULL = win32.NULL + + PIPE_ACCESS_DUPLEX = win32.PIPE_ACCESS_DUPLEX + PIPE_READMODE_MESSAGE = win32.PIPE_READMODE_MESSAGE + PIPE_TYPE_MESSAGE = win32.PIPE_TYPE_MESSAGE + PIPE_WAIT = win32.PIPE_WAIT + PIPE_UNLIMITED_INSTANCES = win32.PIPE_UNLIMITED_INSTANCES + NMPWAIT_WAIT_FOREVER = win32.NMPWAIT_WAIT_FOREVER + + FILE_FLAG_OVERLAPPED = 0x40000000 + FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000 diff --git a/tests/test_windows_events.py b/tests/test_windows_events.py index 8170eba..a6ef951 100644 --- a/tests/test_windows_events.py +++ b/tests/test_windows_events.py @@ -5,12 +5,11 @@ import unittest if sys.platform != 'win32': raise unittest.SkipTest('Windows only') -import _winapi - import asyncio from asyncio import Return from asyncio import _overlapped +from asyncio import _winapi from asyncio import futures from asyncio import protocols from asyncio import streams |