[Numpy-svn] [numpy/numpy] d930c8: FIX: remove a spurious check in get_cast_transfer_...

GitHub noreply@github....
Fri Dec 28 15:16:03 CST 2012


  Branch: refs/heads/maintenance/1.7.x
  Home:   https://github.com/numpy/numpy
  Commit: d930c8827f2f664e8e756de919f9cf3367cfe37b
      https://github.com/numpy/numpy/commit/d930c8827f2f664e8e756de919f9cf3367cfe37b
  Author: Nathaniel J. Smith <njs@pobox.com>
  Date:   2012-12-28 (Fri, 28 Dec 2012)

  Changed paths:
    M numpy/core/src/multiarray/dtype_transfer.c
    M numpy/core/tests/test_dtype.py

  Log Message:
  -----------
  FIX: remove a spurious check in get_cast_transfer_function

At least, I hope it's spurious. Certainly it's creating a spurious
error message, is unexpected by callers (one of whom specifically
makes the *opposite* check before calling get_cast_transfer_function),
and even if it is a useful check for some reason I can't see, it
certainly doesn't belong in this function (which is otherwise just
taking care of byte-swapping and alignment issues and doesn't know
anything about dtypes). And worst case, we'll have turned an exception
into a crash; even if I'm wrong, this shouldn't cause any code to go
from working to not working, just from broken to slightly-more-broken.

Test and original diagnosis by @cgohlke.

Fixes gh-2798.





More information about the Numpy-svn mailing list