Skip to content

Commit 3ea27d1

Browse files
author
Ben Cipollini
committed
basestring => six.string_types
1 parent 0226db3 commit 3ea27d1

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

nibabel/filebasedimages.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99
''' Common interface for any image format--volume or surface, binary or xml.'''
1010

11-
try:
12-
basestring
13-
except NameError: # python 3
14-
basestring = str
15-
1611
import os.path
1712
import warnings
1813

1914
import numpy as np
2015

16+
from .externals.six import string_types
2117
from .fileholders import FileHolder
2218
from .filename_parser import (types_filenames, TypesFilenamesError,
2319
splitext_addext)
@@ -400,7 +396,7 @@ def make_file_map(klass, mapping=None):
400396
for key, ext in klass.files_types:
401397
file_map[key] = FileHolder()
402398
mapval = mapping.get(key, None)
403-
if isinstance(mapval, basestring):
399+
if isinstance(mapval, string_types):
404400
file_map[key].filename = mapval
405401
elif hasattr(mapval, 'tell'):
406402
file_map[key].fileobj = mapval

nibabel/spatialimages.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@
133133
134134
'''
135135

136-
try:
137-
basestring
138-
except NameError: # python 3
139-
basestring = str
140136
import warnings
141137

142138
import numpy as np

0 commit comments

Comments
 (0)