Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions IPython/zmq/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ def base_launch_kernel(code, fname, stdin=None, stdout=None, stderr=None,
creationflags=512, # CREATE_NEW_PROCESS_GROUP
stdin=_stdin, stdout=_stdout, stderr=_stderr)
else:
from _subprocess import DuplicateHandle, GetCurrentProcess, \
DUPLICATE_SAME_ACCESS
try:
from _winapi import DuplicateHandle, GetCurrentProcess, \
DUPLICATE_SAME_ACCESS
except:
from _subprocess import DuplicateHandle, GetCurrentProcess, \
DUPLICATE_SAME_ACCESS
pid = GetCurrentProcess()
handle = DuplicateHandle(pid, pid, pid, 0,
True, # Inheritable by new processes.
Expand Down
5 changes: 4 additions & 1 deletion IPython/zmq/parentpoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ def send_interrupt(interrupt_handle):
def run(self):
""" Run the poll loop. This method never returns.
"""
from _subprocess import WAIT_OBJECT_0, INFINITE
try:
from _winapi import WAIT_OBJECT_0, INFINITE
except ImportError:
from _subprocess import WAIT_OBJECT_0, INFINITE

# Build the list of handle to listen on.
handles = []
Expand Down