From b11f8b73ca3a53913d75846562c4a4457076a1ef Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Mon, 8 Jul 2024 09:37:17 -0500 Subject: [PATCH] Enforce sequence type when setting Setting.track (#3071) --- openmc/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/settings.py b/openmc/settings.py index b048c3a8b34..9731f54ecb1 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -1,4 +1,4 @@ -from collections.abc import Iterable, Mapping, MutableSequence +from collections.abc import Iterable, Mapping, MutableSequence, Sequence from enum import Enum import itertools from math import ceil @@ -819,7 +819,7 @@ def track(self) -> typing.Iterable[typing.Iterable[int]]: @track.setter def track(self, track: typing.Iterable[typing.Iterable[int]]): - cv.check_type('track', track, Iterable) + cv.check_type('track', track, Sequence) for t in track: if len(t) != 3: msg = f'Unable to set the track to "{t}" since its length is not 3'