Skip to content

Commit

Permalink
Do not allow multi-character separators for List[T] parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
libklein committed Apr 17, 2024
1 parent 7eb3fd2 commit cec52c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions typer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,9 @@ def __init__(
self.multiple_separator = multiple_separator

if self.multiple_separator is not None:
if self.multiple_separator.strip() == "":
raise UnsupportedMultipleSeparatorError(
self.name, self.multiple_separator
)
self.multiple_separator = self.multiple_separator.strip()
if len(self.multiple_separator) != 1:
raise UnsupportedMultipleSeparatorError(self.name, multiple_separator)

if not isinstance(self.type, list):
raise MultipleSeparatorForNonListTypeError(self.name)
Expand Down

0 comments on commit cec52c9

Please sign in to comment.