guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: python-ipython: Patch 'ctypes' bug.


From: Federico Beffa
Subject: 01/01: gnu: python-ipython: Patch 'ctypes' bug.
Date: Tue, 15 Dec 2015 17:08:32 +0000

beffa pushed a commit to branch master
in repository guix.

commit fceac8803966dd7988b56e1e26b909c7fede0e05
Author: Federico Beffa <address@hidden>
Date:   Tue Dec 15 17:59:15 2015 +0100

    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.
---
 gnu-system.am                                      |    1 +
 .../patches/python-ipython-inputhook-ctype.patch   |   41 ++++++++++++++++++++
 gnu/packages/python.scm                            |   11 +++--
 3 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/gnu-system.am b/gnu-system.am
index 77a8b2e..0039246 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -640,6 +640,7 @@ dist_patch_DATA =                                           
\
   gnu/packages/patches/python-3-search-paths.patch             \
   gnu/packages/patches/python-disable-ssl-test.patch           \
   gnu/packages/patches/python-fix-tests.patch                  \
+  gnu/packages/patches/python-ipython-inputhook-ctype.patch    \
   gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \
   gnu/packages/patches/python-configobj-setuptools.patch       \
   gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \
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 0000000..c77e310
--- /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 <address@hidden>
+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
+ 
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 6a05101..95c24a6 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -4194,11 +4194,12 @@ without using the configuration machinery.")
     (version "3.2.1")
     (source
      (origin
-      (method url-fetch)
-      (uri (string-append "https://pypi.python.org/packages/source/i/";
-                          "ipython/ipython-" version ".tar.gz"))
-      (sha256
-       (base32 "0xwin0sa9n0cabx4cq1ibf5ldsiw5dyimibla82kicz5gbpas4y9"))))
+       (method url-fetch)
+       (patches (list (search-patch "python-ipython-inputhook-ctype.patch")))
+       (uri (string-append "https://pypi.python.org/packages/source/i/";
+                           "ipython/ipython-" version ".tar.gz"))
+       (sha256
+        (base32 "0xwin0sa9n0cabx4cq1ibf5ldsiw5dyimibla82kicz5gbpas4y9"))))
     (build-system python-build-system)
     (outputs '("out" "doc"))
     (propagated-inputs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]