From 8501456c25a691d3f99784af78b48ef607bc9318 2012-02-19 03:10:30 From: MinRK Date: 2012-02-19 03:10:30 Subject: [PATCH] avoid ctypes import in parentpoller when unnecessary --- diff --git a/IPython/zmq/parentpoller.py b/IPython/zmq/parentpoller.py index bdbaf7b..dec2e7b 100644 --- a/IPython/zmq/parentpoller.py +++ b/IPython/zmq/parentpoller.py @@ -1,5 +1,8 @@ # Standard library imports. -import ctypes +try: + import ctypes +except: + ctypes = None import os import platform import time @@ -54,6 +57,8 @@ class ParentPollerWindows(Thread): """ assert(interrupt_handle or parent_handle) super(ParentPollerWindows, self).__init__() + if ctypes is None: + raise ImportError("ParentPollerWindows requires ctypes") self.daemon = True self.interrupt_handle = interrupt_handle self.parent_handle = parent_handle