File: 0001-fix-upstream-wrong-six-import.patch

package info (click to toggle)
python-fabio 0.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,788 kB
  • ctags: 6,209
  • sloc: python: 12,748; ansic: 1,091; makefile: 129
file content (72 lines) | stat: -rw-r--r-- 1,950 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From: =?utf-8?q?Picca_Fr=C3=A9d=C3=A9ric-Emmanuel?=
 <picca@synchrotron-soleil.fr>
Date: Wed, 27 Jul 2016 18:57:21 +0200
Subject: fix-upstream-wrong-six-import

---
 fabio/compression.py |  7 +------
 fabio/fabioimage.py  | 12 +-----------
 fabio/fabioutils.py  |  8 +-------
 3 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/fabio/compression.py b/fabio/compression.py
index 54a4c4c..885640a 100644
--- a/fabio/compression.py
+++ b/fabio/compression.py
@@ -46,12 +46,7 @@ import subprocess
 import numpy
 
 
-try:
-    from .third_party import six
-except ImportError:
-    import six
-    if tuple(int(i) for i in six.__version__.split(".")[:2]) < (1, 8):
-        raise ImportError("Six version is too old")
+import six
 if six.PY2:
     bytes = str
 
diff --git a/fabio/fabioimage.py b/fabio/fabioimage.py
index 81d728b..d3235d3 100644
--- a/fabio/fabioimage.py
+++ b/fabio/fabioimage.py
@@ -49,17 +49,8 @@ except ImportError:
     Image = None
 from . import fabioutils, converters
 
-try:
-    from .third_party.six import with_metaclass
-except ImportError:
-    import six
-    six_version = tuple(int(i) for i in six.__version__.split() if i.isdigit())
-    if six_version < (1, 8):
-        for i in ("six", "six.moves"):
-            sys.modules.pop(i, None)
-        raise ImportError("Old version")
-    from six import with_metaclass
-
+import six
+from six import with_metaclass
 
 try:
     from collections import OrderedDict
diff --git a/fabio/fabioutils.py b/fabio/fabioutils.py
index a2408c0..b799541 100644
--- a/fabio/fabioutils.py
+++ b/fabio/fabioutils.py
@@ -40,13 +40,7 @@ import logging
 import sys
 logger = logging.getLogger("fabioutils")
 
-try:
-    from .third_party import six
-except ImportError:
-    import six
-    if tuple(int(i) for i in six.__version__.split(".")[:2]) < (1, 8):
-        raise ImportError("Six version is too old")
-
+import six
 if six.PY2:
     bytes = str
     FileIO = file