summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorFederico Beffa <beffa@fbengineering.ch>2015-12-15 17:59:15 +0100
committerFederico Beffa <beffa@fbengineering.ch>2015-12-15 18:05:42 +0100
commitfceac8803966dd7988b56e1e26b909c7fede0e05 (patch)
tree12637a64a93d51c41c4fcfd51a7e56988b035424 /gnu/packages/patches
parent5bd88cf1e3ebca19dccd68129258e8f365b2ae3c (diff)
downloadguix-fceac8803966dd7988b56e1e26b909c7fede0e05.tar.gz
gnu: python-ipython: Patch 'ctypes' bug.
* gnu/packages/patches/python-ipython-inputhook-ctype.patch: New patch.
* gnu/packages/python.scm (python-ipython): Use it.
* gnu-system.am (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/python-ipython-inputhook-ctype.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-ipython-inputhook-ctype.patch b/gnu/packages/patches/python-ipython-inputhook-ctype.patch
new file mode 100644
index 0000000000..c77e310542
--- /dev/null
+++ b/gnu/packages/patches/python-ipython-inputhook-ctype.patch
@@ -0,0 +1,41 @@
+From 04c5d358c7ab74d3ddab4f7662e539393d8604c6 Mon Sep 17 00:00:00 2001
+From: Lucretiel <Lucretiel@users.noreply.github.com>
+Date: Wed, 13 May 2015 13:12:43 -0400
+Subject: [PATCH] register now checks for missing ctypes
+
+If ctypes is None, then no input hooks may be registered; `InputHookManager.register` skips registration of input hook classes. Also updated `__init__` to no longer skip creating the instance attributes, to prevent AttributeError exceptions at load time.
+---
+ IPython/lib/inputhook.py | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/IPython/lib/inputhook.py b/IPython/lib/inputhook.py
+index 4ae2cb3..6578365 100644
+--- a/IPython/lib/inputhook.py
++++ b/IPython/lib/inputhook.py
+@@ -107,8 +107,8 @@ class InputHookManager(object):
+     def __init__(self):
+         if ctypes is None:
+             warn("IPython GUI event loop requires ctypes, %gui will not be available")
+-            return
+-        self.PYFUNC = ctypes.PYFUNCTYPE(ctypes.c_int)
++        else:
++            self.PYFUNC = ctypes.PYFUNCTYPE(ctypes.c_int)
+         self.guihooks = {}
+         self.aliases = {}
+         self.apps = {}
+@@ -197,10 +197,11 @@ def enable(self, app=None):
+                     ...
+         """
+         def decorator(cls):
+-            inst = cls(self)
+-            self.guihooks[toolkitname] = inst
+-            for a in aliases:
+-                self.aliases[a] = toolkitname
++            if ctypes is not None:
++                inst = cls(self)
++                self.guihooks[toolkitname] = inst
++                for a in aliases:
++                    self.aliases[a] = toolkitname
+             return cls
+         return decorator
+