diff options
-rw-r--r-- | numpy/core/tests/test_defchararray.py | 9 | ||||
-rwxr-xr-x | tools/py3tool.py | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/numpy/core/tests/test_defchararray.py b/numpy/core/tests/test_defchararray.py index 721e7fb3c..358aebe68 100644 --- a/numpy/core/tests/test_defchararray.py +++ b/numpy/core/tests/test_defchararray.py @@ -4,6 +4,9 @@ import numpy as np import sys from numpy.core.multiarray import _vec_string +kw_unicode_true = {'unicode': True} +kw_unicode_false = {'unicode': False} + class TestBasic(TestCase): def test_from_object_array(self): A = np.array([['abc', 2], @@ -16,7 +19,7 @@ class TestBasic(TestCase): A = np.array([['abc', u'Sigma \u03a3'], ['long ', '0123456789']], dtype='O') self.failUnlessRaises(ValueError, np.char.array, (A,)) - B = np.char.array(A, unicode=True) + B = np.char.array(A, **kw_unicode_true) assert_equal(B.dtype.itemsize, 10 * np.array('a', 'U').dtype.itemsize) assert_array_equal(B, [['abc', u'Sigma \u03a3'], ['long', '0123456789']]) @@ -45,12 +48,12 @@ class TestBasic(TestCase): assert_array_equal(B, A) assert_equal(B.dtype, A.dtype) assert_equal(B.shape, A.shape) - B = np.char.array(A, unicode=True) + B = np.char.array(A, **kw_unicode_true) assert_array_equal(B, A) assert_equal(B.dtype, A.dtype) assert_equal(B.shape, A.shape) def fail(): - B = np.char.array(A, unicode=False) + B = np.char.array(A, **kw_unicode_false) self.failUnlessRaises(UnicodeEncodeError, fail) def test_unicode_upconvert(self): diff --git a/tools/py3tool.py b/tools/py3tool.py index d1a587d6b..33c20022c 100755 --- a/tools/py3tool.py +++ b/tools/py3tool.py @@ -35,7 +35,6 @@ EXTRA_2TO3_FLAGS = { 'numpy/core/code_generators/generate_numpy_api.py': '-x import', 'numpy/core/code_generators/generate_ufunc_api.py': '-x import', 'numpy/core/defchararray.py': '-x unicode', - 'numpy/core/tests/test_defchararray.py': '-x unicode', 'numpy/compat/py3k.py': '-x unicode', } |