mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-02-07 11:30:17 +00:00
Fixes wait for named pipe creation.
This commit is contained in:
parent
32f9baf682
commit
82540e5366
@ -111,13 +111,15 @@ def wait_for_file_creation(path, timeout=10):
|
|||||||
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def wait_for_named_pipe_creation(pipe_path, timeout=10):
|
def wait_for_named_pipe_creation(pipe_path, timeout=60):
|
||||||
|
|
||||||
|
import win32pipe
|
||||||
|
import pywintypes
|
||||||
|
|
||||||
while timeout > 0:
|
while timeout > 0:
|
||||||
try:
|
try:
|
||||||
with open(pipe_path, "a+b"):
|
win32pipe.WaitNamedPipe(pipe_path, 1)
|
||||||
pass
|
except pywintypes.error:
|
||||||
except OSError:
|
|
||||||
yield from asyncio.sleep(0.5)
|
yield from asyncio.sleep(0.5)
|
||||||
timeout -= 0.5
|
timeout -= 0.5
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user