[magics] 19/63: py3 fixes
Alastair McKinstry
mckinstry at moszumanska.debian.org
Fri Mar 24 10:41:50 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository magics.
commit eac0f1c799995185893066f081c1af34dcb01b23
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Thu Jun 16 07:19:43 2016 +0100
py3 fixes
---
debian/patches/numpy-fixes.patch | 13 +++++++++++++
debian/patches/python3.patch | 33 ++++++++++++++++++++++++++++++++-
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/debian/patches/numpy-fixes.patch b/debian/patches/numpy-fixes.patch
index a6cc58e..953444d 100644
--- a/debian/patches/numpy-fixes.patch
+++ b/debian/patches/numpy-fixes.patch
@@ -2672,3 +2672,16 @@ Index: magics++-2.28.0/python/Magics/numpy.i
+#endif
#endif /* SWIGPYTHON */
+Index: magics++-2.28.0/python/Magics/Magics.i.in
+===================================================================
+--- magics++-2.28.0.orig/python/Magics/Magics.i.in
++++ magics++-2.28.0/python/Magics/Magics.i.in
+@@ -22,7 +22,7 @@
+ int i = 0;
+ $1 = (char **) malloc((size+1)*sizeof(char *));
+ $2 = size;
+-%#IF PY_MAJOR_VERSION < 3
++%#if PY_MAJOR_VERSION < 3
+ for (i = 0; i < size; i++) {
+ PyObject *o = PyList_GetItem($input,i);
+ if (PyString_Check(o))
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 93e4a1c..fa44a7d 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -572,7 +572,7 @@ Index: magics++-2.28.0/python/Magics/macro.py
+ print ("pset2i")
else :
- print "pset1i"
-+ print I"pset1i")
++ print ("pset1i")
elif ( type == 'float64' or type == 'float32') :
if (dim == 2) :
- print "pset2r"
@@ -910,3 +910,34 @@ Index: magics++-2.28.0/test/grib.py
plot( output, europe, data, cont, coast, title)
+Index: magics++-2.28.0/python/Magics/Magics.i.in
+===================================================================
+--- magics++-2.28.0.orig/python/Magics/Magics.i.in
++++ magics++-2.28.0/python/Magics/Magics.i.in
+@@ -22,6 +22,18 @@
+ int i = 0;
+ $1 = (char **) malloc((size+1)*sizeof(char *));
+ $2 = size;
++%#IF PY_MAJOR_VERSION < 3
++ for (i = 0; i < size; i++) {
++ PyObject *o = PyList_GetItem($input,i);
++ if (PyString_Check(o))
++ $1[i] = PyString_AsString(PyList_GetItem($input,i));
++ else {
++ PyErr_SetString(PyExc_TypeError,"list must contain strings");
++ free($1);
++ return NULL;
++ }
++ }
++%#else
+ for (i = 0; i < size; i++) {
+ PyObject *o = PyList_GetItem($input,i);
+ if (PyString_Check(o))
+@@ -32,6 +44,7 @@
+ return NULL;
+ }
+ }
++%#endif
+ $1[i] = 0;
+ }
+ else
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/magics.git
More information about the debian-science-commits
mailing list