Skip to content

Commit 664a860

Browse files
committed
FIX: Listify numbers
1 parent 8ba2914 commit 664a860

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

niworkflows/utils/connections.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def listify(value):
6767
[0.1, 0.2]
6868
>>> listify(None) is None
6969
True
70+
>>> listify(1)
71+
[1]
7072
7173
"""
7274
from pathlib import Path
@@ -77,4 +79,6 @@ def listify(value):
7779
return value
7880
if isinstance(value, (str, bytes, Path)):
7981
return [str(value)]
82+
if isinstance(value, (int, float)):
83+
return [value]
8084
return list(value)

0 commit comments

Comments
 (0)