Skip to content

Commit 9ff8641

Browse files
committed
_valid_type_or_fail now returns type
1 parent 3f9f8e0 commit 9ff8641

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

wolframclient/language/array.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ def __init__(self, array, type, shape=None):
1717

1818
self.array = array
1919
self.shape = shape or (len(array),)
20-
self.type = type
21-
self._valid_type_or_fail(type)
22-
self.struct = constants.STRUCT_MAPPING[type]
20+
self.type = self._valid_type_or_fail(type)
21+
self.struct = constants.STRUCT_MAPPING[self.type]
2322

2423
def _valid_type_or_fail(self, type):
2524
if type not in constants.STRUCT_MAPPING:
2625
raise WolframLanguageException(
2726
"Type %s is not one of the supported array types: %s."
2827
% (type, ", ".join(constants.STRUCT_MAPPING.keys()))
2928
)
29+
return type
3030

3131
def tobytes(self):
3232
return struct.pack(

0 commit comments

Comments
 (0)