summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
authorBrigitta Sipőcz <bsipocz@gmail.com>2022-05-17 20:37:38 -0700
committerBrigitta Sipőcz <bsipocz@gmail.com>2022-05-17 20:37:38 -0700
commitae1648437863aa322785dac60f33db86fa028e99 (patch)
tree1658a687c7c5fe15aa72e967e2845a38f51868e8 /numpy/lib/format.py
parent1dde871ee7977f6561358c777cfb1fa4c18bf916 (diff)
downloadnumpy-ae1648437863aa322785dac60f33db86fa028e99.tar.gz
Addressing review for more cleanup and clarification
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r--numpy/lib/format.py3
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: