diff options
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r-- | numpy/lib/format.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py index dfd50b393..625768b62 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -370,8 +370,7 @@ def _wrap_header(header, version): import struct assert version is not None fmt, encoding = _header_size_info[version] - if not isinstance(header, bytes): - header = header.encode(encoding) + header = header.encode(encoding) hlen = len(header) + 1 padlen = ARRAY_ALIGN - ((MAGIC_LEN + struct.calcsize(fmt) + hlen) % ARRAY_ALIGN) try: |