From c930effc7f55764f4f7e3b5e934fbe5307a07bd5 2012-10-11 19:48:47 From: MinRK Date: 2012-10-11 19:48:47 Subject: [PATCH] use new _winapi instead of removed _subprocess `_subprocess` is removed in Python 3.3, and the relevant names relocated to a new `_winapi` module. ref: http://bugs.python.org/issue11750 closes #2471 should be back ported to 0.13.1 --- diff --git a/IPython/zmq/entry_point.py b/IPython/zmq/entry_point.py index dff9286..031036f 100644 --- a/IPython/zmq/entry_point.py +++ b/IPython/zmq/entry_point.py @@ -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. diff --git a/IPython/zmq/parentpoller.py b/IPython/zmq/parentpoller.py index 5cf0b57..7a6e31d 100644 --- a/IPython/zmq/parentpoller.py +++ b/IPython/zmq/parentpoller.py @@ -100,7 +100,10 @@ class ParentPollerWindows(Thread): 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 = []