From 82540e5366dd3f637d2deb457a12ed862bf24445 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 1 Nov 2015 20:52:07 -0700 Subject: [PATCH] Fixes wait for named pipe creation. --- gns3server/utils/asyncio.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gns3server/utils/asyncio.py b/gns3server/utils/asyncio.py index cc73e1b5..3d2f2017 100644 --- a/gns3server/utils/asyncio.py +++ b/gns3server/utils/asyncio.py @@ -111,13 +111,15 @@ def wait_for_file_creation(path, timeout=10): @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: try: - with open(pipe_path, "a+b"): - pass - except OSError: + win32pipe.WaitNamedPipe(pipe_path, 1) + except pywintypes.error: yield from asyncio.sleep(0.5) timeout -= 0.5 else: