8000 Merge pull request #1331 from jhlegarreta/FixNpCompatWarning · nipy/nibabel@0ebf390 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ebf390

Browse files
authored
Merge pull request #1331 from jhlegarreta/FixNpCompatWarning
RF: Remove unnecessary call to `asbytes` for `b`-prepended strings
2 parents 0da8c1c + d1235a6 commit 0ebf390

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nibabel/streamlines/tests/test_streamlines.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import numpy as np
88
import pytest
9-
from numpy.compat.py3k import asbytes
109

1110
import nibabel as nib
1211
from nibabel.testing import clear_and_catch_warnings, data_path, error_warnings
@@ -95,7 +94,7 @@ def test_is_supported_detect_format(tmp_path):
9594
# Valid file without extension
9695
for tfile_cls in FORMATS.values():
9796
f = BytesIO()
98-
f.write(asbytes(tfile_cls.MAGIC_NUMBER))
97+
f.write(tfile_cls.MAGIC_NUMBER)
9998
f.seek(0, os.SEEK_SET)
10099
assert nib.streamlines.is_supported(f)
101100
assert nib.streamlines.detect_format(f) is tfile_cls
@@ -104,7 +103,7 @@ def test_is_supported_detect_format(tmp_path):
104103
for tfile_cls in FORMATS.values():
105104
fpath = tmp_path / 'test.txt'
106105
with open(fpath, 'w+b') as f:
107-
f.write(asbytes(tfile_cls.MAGIC_NUMBER))
106+
f.write(tfile_cls.MAGIC_NUMBER)
108107
f.seek(0, os.SEEK_SET)
109108
assert nib.streamlines.is_supported(f)
110109
assert nib.streamlines.detect_format(f) is tfile_cls

0 commit comments

Comments
 (0)
0