File: remove_six.patch

package info (click to toggle)
keras-preprocessing 1.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 508 kB
  • sloc: python: 4,154; makefile: 11; sh: 10
file content (65 lines) | stat: -rw-r--r-- 1,937 bytes parent folder | download
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
Forwarded: no, project is archived

--- a/keras_preprocessing/image/directory_iterator.py
+++ b/keras_preprocessing/image/directory_iterator.py
@@ -6,7 +6,6 @@
 
 import os
 import multiprocessing.pool
-from six.moves import range
 
 import numpy as np
 
--- a/keras_preprocessing/image/image_data_generator.py
+++ b/keras_preprocessing/image/image_data_generator.py
@@ -5,7 +5,6 @@
 from __future__ import print_function
 
 import warnings
-from six.moves import range
 
 import numpy as np
 
--- a/keras_preprocessing/sequence.py
+++ b/keras_preprocessing/sequence.py
@@ -8,8 +8,6 @@
 import numpy as np
 import random
 import json
-from six.moves import range
-import six
 
 
 def pad_sequences(sequences, maxlen=None, dtype='int32',
@@ -77,7 +75,7 @@
         maxlen = np.max(lengths)
 
     is_dtype_str = np.issubdtype(dtype, np.str_) or np.issubdtype(dtype, np.unicode_)
-    if isinstance(value, six.string_types) and dtype != object and not is_dtype_str:
+    if isinstance(value, str) and dtype != object and not is_dtype_str:
         raise ValueError("`dtype` {} is not compatible with `value`'s type: {}\n"
                          "You should set `dtype=object` for variable length strings."
                          .format(dtype, type(value)))
--- a/keras_preprocessing/text.py
+++ b/keras_preprocessing/text.py
@@ -14,8 +14,6 @@
 import json
 
 import numpy as np
-from six.moves import range
-from six.moves import zip
 
 if sys.version_info < (3,):
     maketrans = string.maketrans
--- a/setup.py
+++ b/setup.py
@@ -32,8 +32,7 @@
       download_url='https://github.com/keras-team/'
                    'keras-preprocessing/tarball/1.1.2',
       license='MIT',
-      install_requires=['numpy>=1.9.1',
-                        'six>=1.9.0'],
+      install_requires=['numpy>=1.9.1'],
       extras_require={
           'tests': ['pandas',
                     'Pillow' if sys.version_info >= (3, 0) else 'pillow',