Skip to content

Commit e73e3d2

Browse files
committed
String to bytes.
1 parent 98930e9 commit e73e3d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/freesurfer/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def _serialize_volume_info(volume_info):
462462
if not (np.array_equal(volume_info[key], [20]) or np.array_equal(
463463
volume_info[key], [2, 0, 20])):
464464
warnings.warn("Unknown extension code.")
465-
strings.append(np.array(volume_info[key], dtype='>i4').tostring())
465+
strings.append(np.array(volume_info[key], dtype='>i4').tobytes())
466466
elif key in ('valid', 'filename'):
467467
val = volume_info[key]
468468
strings.append('{0} = {1}\n'.format(key, val).encode('utf-8'))
@@ -474,4 +474,4 @@ def _serialize_volume_info(volume_info):
474474
val = volume_info[key]
475475
strings.append('{0} = {1:f} {2:f} {3:f}\n'.format(
476476
key.ljust(6), val[0], val[1], val[2]).encode('utf-8'))
477-
return ''.join(strings)
477+
return b''.join(strings)

0 commit comments

Comments
 (0)