Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions prefab_cloud_python/config_resolver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations
import functools
from collections.abc import Sequence

from .read_write_lock import ReadWriteLock
from .config_value_unwrapper import ConfigValueUnwrapper
Expand All @@ -13,7 +14,6 @@
RegexMatchOperators,
)
import prefab_pb2 as Prefab
import google

logger = InternalLogger(__name__)

Expand Down Expand Up @@ -176,11 +176,11 @@ def negate(negate, value):

@staticmethod
def _ensure_list(value):
return (
value
if isinstance(value, (list, google._upb._message.RepeatedScalarContainer))
else [value]
)
if isinstance(value, list):
return value
if isinstance(value, Sequence) and not isinstance(value, (str, bytes)):
return list(value) # Convert other sequences to lists
return [value] # Wrap everything else in a list

def one_of(self, criterion, value, properties):
criterion_value_or_values = ConfigValueUnwrapper.deepest_value(
Expand Down
Loading