Skip to content

Commit

Permalink
Fix possible regression in file writing that caused use of ndarray.to…
Browse files Browse the repository at this point in the history
…file to be skipped over on a direct copy write
  • Loading branch information
embray committed Nov 13, 2015
1 parent 2417fc2 commit df93272
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions astropy/io/fits/hdu/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
from ..file import _File
from ..header import Header, _pad_length
from ..util import (_is_int, _is_pseudo_unsigned, _unsigned_zero,
itersubclasses, decode_ascii,
_get_array_mmap, _array_to_file, first)
itersubclasses, decode_ascii, _get_array_mmap, first)
from ..verify import _Verify, _ErrList

from ....extern.six import string_types, add_metaclass
Expand Down Expand Up @@ -727,7 +726,7 @@ def _writedata_direct_copy(self, fileobj):

raw = self._get_raw_data(self._data_size, 'ubyte', self._data_offset)
if raw is not None:
_array_to_file(raw, fileobj)
fileobj.writearray(raw)
return raw.nbytes
else:
return 0
Expand Down

0 comments on commit df93272

Please sign in to comment.