Skip to content

Commit 2755652

Browse files
committed
fic(connection): str is itself a Sequence[str], so iterating it would yield individual characters
1 parent 602ea8d commit 2755652

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ardupilot_methodic_configurator/backend_flightcontroller_connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ def discover_connections(
187187
# Merge caller-supplied preserved connections (e.g. persistent history) that are not auto-discovered
188188
if preserved_connections:
189189
auto_discovered = {t[0] for t in self._connection_tuples}
190-
for conn in preserved_connections:
190+
# Guard: str is itself a Sequence[str], so iterating it would yield individual characters.
191+
# Treat a bare string as a single preserved connection rather than a char sequence.
192+
preserved_iter = (preserved_connections,) if isinstance(preserved_connections, str) else preserved_connections
193+
for conn in preserved_iter:
191194
# Skip falsy/empty connection identifiers
192195
if not conn:
193196
continue

0 commit comments

Comments
 (0)