Skip to content

Commit 267304c

Browse files
committed
Fix BytesIO import (again), py3.3 compat
1 parent f591ee3 commit 267304c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

nibabel/nifti1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def get_sizeondisk(self):
434434
from dicom.filewriter import write_dataset
435435
from dicom.filebase import DicomFileLike
436436
from dicom.values import converters as dicom_converters
437-
from six import BytesIO
437+
from io import BytesIO
438438
except ImportError:
439439
"""Fall back to standard reader if pydicom unavailable."""
440440
Nifti1DicomExtension = Nifti1Extension

nibabel/tests/test_nifti1.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,17 +1088,15 @@ def test_nifti_dicom_extension():
10881088

10891089
# create a single dicom tag (Patien ID, [0010,0020]) with Explicit VR
10901090
dcmbytes = struct.pack('<HH2sH4s',0x10,0x20,
1091-
u'LO'.encode('utf-8'),
1092-
4,
1093-
u'NiPy'.encode('utf-8'))
1091+
'LO'.encode('utf-8'),4,'NiPy'.encode('utf-8'))
10941092
dcmext = Nifti1DicomExtension(2,dcmbytes)
10951093
assert_equal(dcmext.__class__, Nifti1DicomExtension)
10961094
assert_equal(dcmext.get_content().PatientID, 'NiPy')
10971095
assert_equal(len(dcmext.get_content().values()), 1)
10981096

10991097
# create a single dicom tag (Patien ID, [0010,0020]) with Implicit VR
11001098
dcmext = Nifti1DicomExtension(2,
1101-
struct.pack('<HHL4s',0x10,0x20,4,u'NiPy'.encode('utf-8')))
1099+
struct.pack('<HHL4s',0x10,0x20,4,'NiPy'.encode('utf-8')))
11021100
assert_equal(dcmext.get_content().PatientID, 'NiPy')
11031101
assert_equal(len(dcmext.get_content().values()), 1)
11041102

0 commit comments

Comments
 (0)