Skip to content

Commit 2b7a2e3

Browse files
committed
DataTraits.dataTypeFromElement : Fix errors when receiving a list
`__dataTypesConversionDict` contains an item that returns a `None` value which would cause an error.
1 parent 5fb3e51 commit 2b7a2e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/IECore/DataTraits.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ def dataTypeFromElement(element):
263263
# We have to check the list contents.
264264
elementValueType = type(element[0])
265265
for (dataType, value) in __dataTypesConversionDict.items():
266+
if value is None:
267+
continue
266268
if value[0] is list and len(value) >= 2 and value[2] is elementValueType:
267269
return dataType
268270

0 commit comments

Comments
 (0)