diff options
author | Jay Bourque <jay.bourque@continuum.io> | 2012-12-21 14:29:52 -0600 |
---|---|---|
committer | Ondřej Čertík <ondrej.certik@gmail.com> | 2012-12-26 09:18:40 -0800 |
commit | 1f1537eff87721f9d3829513eadb1fe85fc1d866 (patch) | |
tree | eb2c6879d6c79ac089a83af1cb4a3659b3de1131 | |
parent | 0f5afde4b719d622f4530c707d9577eea6c131fd (diff) | |
download | numpy-1f1537eff87721f9d3829513eadb1fe85fc1d866.tar.gz |
Add fix to unit test; remove debug logging
Add check to see if 12 bytes is a valid size for a long double
-rw-r--r-- | numpy/core/src/multiarray/conversion_utils.c | 10 | ||||
-rw-r--r-- | numpy/core/tests/test_dtype.py | 6 |
2 files changed, 5 insertions, 11 deletions
diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c index 7adf6ae20..b05314a0a 100644 --- a/numpy/core/src/multiarray/conversion_utils.c +++ b/numpy/core/src/multiarray/conversion_utils.c @@ -1116,19 +1116,9 @@ PyArray_TypestrConvert(int itemsize, int gentype) * This should eventually be changed to an error in * future NumPy versions. */ - - if (newtype == NPY_NOTYPE) - { - printf("XXX: gentype=%c\n", gentype); - } if (newtype == NPY_NOTYPE) { temp = PyArray_DescrFromType(gentype); - - if (gentype == 'g') - printf("XXX: temp=%x\n", temp); if (temp != NULL) { - if (gentype == 'g') - printf("XXX: elsize=%d itemsize=%d\n", temp->elsize, itemsize); if (temp->elsize != itemsize) { if (DEPRECATE(msg) < 0) { Py_DECREF(temp); diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py index ad8e5a8b3..92e335165 100644 --- a/numpy/core/tests/test_dtype.py +++ b/numpy/core/tests/test_dtype.py @@ -60,7 +60,11 @@ class TestBuiltin(TestCase): assert_warns(DeprecationWarning, np.dtype, 'I5') assert_warns(DeprecationWarning, np.dtype, 'e3') assert_warns(DeprecationWarning, np.dtype, 'f5') - assert_warns(DeprecationWarning, np.dtype, 'g12') + + if np.dtype('g').itemsize == 8 or np.dtype('g').itemsize == 16: + assert_warns(DeprecationWarning, np.dtype, 'g12') + elif np.dtype('g').itemsize == 12: + assert_warns(DeprecationWarning, np.dtype, 'g16') if np.dtype('l').itemsize == 8: assert_warns(DeprecationWarning, np.dtype, 'l4') |