From ae1648437863aa322785dac60f33db86fa028e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Tue, 17 May 2022 20:37:38 -0700 Subject: Addressing review for more cleanup and clarification --- numpy/lib/format.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/lib/format.py') 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: -- cgit v1.2.1