Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove hard dependecy on ctypes.

Closes gh-1394.
  • Loading branch information...
commit 215ae51f93eac0fab9036a2921196a2bce92348d 1 parent 0291d61
@bfroehle authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 IPython/lib/inputhook.py
View
11 IPython/lib/inputhook.py
@@ -14,10 +14,14 @@
# Imports
#-----------------------------------------------------------------------------
-import ctypes
+try:
+ import ctypes
+except ImportError:
+ ctypes = None
import os
import sys
-import warnings
+
+from IPython.utils.warn import warn
#-----------------------------------------------------------------------------
# Constants
@@ -98,6 +102,9 @@ class InputHookManager(object):
"""
def __init__(self):
+ if ctypes is None:
+ warn("IPython GUI event loop requires ctypes, %gui will not be available\n")
+ return
self.PYFUNC = ctypes.PYFUNCTYPE(ctypes.c_int)
self._apps = {}
self._reset()
Please sign in to comment.
Something went wrong with that request. Please try again.