Skip to content

Commit 4cf0a80

Browse files
markhymerseffigies
authored andcommitted
Fix FutureWarning in python3
Use of the set_dim_info function showed up a FutureWarning error in python3. python3 now really dislikes comparing to None using ==, which is what "in" does. Work around this to silence the warning. Signed-off-by: Mark Hymers <[email protected]>
1 parent 71b79b5 commit 4cf0a80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nibabel/nifti1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ def set_dim_info(self, freq=None, phase=None, slice=None):
12741274
This is stored in one byte in the header
12751275
'''
12761276
for inp in (freq, phase, slice):
1277-
if inp not in (None, 0, 1, 2):
1277+
if inp is not None and inp not in (0, 1, 2):
12781278
raise HeaderDataError('Inputs must be in [None, 0, 1, 2]')
12791279
info = 0
12801280
if freq is not None:

0 commit comments

Comments
 (0)