File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ def _read_annot_ctab_old_format(fobj, n_entries):
402402 Parameters
403403 ----------
404404
405- fobj : file
405+ fobj : file-like
406406 Open file handle to a Freesurfer `.annot` file, with seek point
407407 at the beginning of the color table data.
408408 n_entries : int
@@ -416,8 +416,9 @@ def _read_annot_ctab_old_format(fobj, n_entries):
416416 names : list of str
417417 The names of the labels. The length of the list is n_entries.
418418 """
419- dt = _ANNOT_DT
419+ assert hasattr ( fobj , 'read' )
420420
421+ dt = _ANNOT_DT
421422 # orig_tab string length + string
422423 length = np .fromfile (fobj , dt , 1 )[0 ]
423424 orig_tab = np .fromfile (fobj , '>c' , length )
@@ -443,7 +444,7 @@ def _read_annot_ctab_new_format(fobj, ctab_version):
443444 Parameters
444445 ----------
445446
446- fobj : file
447+ fobj : file-like
447448 Open file handle to a Freesurfer `.annot` file, with seek point
448449 at the beginning of the color table data.
449450 ctab_version : int
@@ -457,6 +458,8 @@ def _read_annot_ctab_new_format(fobj, ctab_version):
457458 names : list of str
458459 The names of the labels. The length of the list is n_labels.
459460 """
461+ assert hasattr (fobj , 'read' )
462+
460463 dt = _ANNOT_DT
461464 # This code works with a file version == 2, nothing else
462465 if ctab_version != 2 :
You can’t perform that action at this time.
0 commit comments