summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-05-26 15:16:14 +0200
committerWillem Jan Palenstijn <wjp@usecode.org>2015-05-26 15:16:14 +0200
commit91977939eb7add4c503795a1e0b3fe6938b07404 (patch)
tree9b7b3b8492f40db759a11254a03fe3cd4766d846 /python
parentf5c3a7c07d834eabc4abb78834c952bbfcf0c906 (diff)
parentaed157812c31df681a7ba7dd4479cb35fbce05bb (diff)
downloadastra-91977939eb7add4c503795a1e0b3fe6938b07404.tar.gz
astra-91977939eb7add4c503795a1e0b3fe6938b07404.tar.bz2
astra-91977939eb7add4c503795a1e0b3fe6938b07404.tar.xz
astra-91977939eb7add4c503795a1e0b3fe6938b07404.zip
Merge pull request #66 from dmpelt/fix-old-six
Fix range import for old six versions
Diffstat (limited to 'python')
-rw-r--r--python/astra/functions.py6
-rw-r--r--python/astra/matrix_c.pyx7
-rw-r--r--python/astra/optomo.py8
3 files changed, 18 insertions, 3 deletions
diff --git a/python/astra/functions.py b/python/astra/functions.py
index b826b86..e38b5bc 100644
--- a/python/astra/functions.py
+++ b/python/astra/functions.py
@@ -32,7 +32,11 @@
from . import creators as ac
import numpy as np
-from six.moves import range
+try:
+ from six.moves import range
+except ImportError:
+ # six 1.3.0
+ from six.moves import xrange as range
from . import data2d
from . import data3d
diff --git a/python/astra/matrix_c.pyx b/python/astra/matrix_c.pyx
index b0d8bc4..d099a75 100644
--- a/python/astra/matrix_c.pyx
+++ b/python/astra/matrix_c.pyx
@@ -27,7 +27,12 @@
# distutils: libraries = astra
import six
-from six.moves import range
+try:
+ from six.moves import range
+except ImportError:
+ # six 1.3.0
+ from six.moves import xrange as range
+
import numpy as np
import scipy.sparse as ss
diff --git a/python/astra/optomo.py b/python/astra/optomo.py
index 0c37353..2937d9c 100644
--- a/python/astra/optomo.py
+++ b/python/astra/optomo.py
@@ -32,7 +32,13 @@ from . import creators
from . import algorithm
from . import functions
import numpy as np
-from six.moves import range, reduce
+from six.moves import reduce
+try:
+ from six.moves import range
+except ImportError:
+ # six 1.3.0
+ from six.moves import xrange as range
+
import operator
import scipy.sparse.linalg