use lists instead of sets
This commit is contained in:
@@ -224,7 +224,7 @@ class Dictionary:
|
||||
def _parse_vendor(self, tokens: Sequence[str], line_num: int):
|
||||
"""Parse the vendor definition"""
|
||||
filename = self.filestack[-1]
|
||||
if len(tokens) not in {3, 4}:
|
||||
if len(tokens) not in [3, 4]:
|
||||
raise ParseError(
|
||||
filename, "Incorrect number of tokens for vendor statement"
|
||||
)
|
||||
@@ -244,13 +244,13 @@ class Dictionary:
|
||||
try:
|
||||
vendor_format = vendor_format[1].split(",")
|
||||
t_len, l_len = (int(a) for a in vendor_format[:2])
|
||||
if t_len not in {1, 2, 4}:
|
||||
if t_len not in [1, 2, 4]:
|
||||
raise ParseError(
|
||||
filename,
|
||||
f'Invalid type length definition "{t_len}" for vendor {vendor_name}',
|
||||
line_num,
|
||||
)
|
||||
if l_len not in {0, 1, 2}:
|
||||
if l_len not in [0, 1, 2]:
|
||||
raise ParseError(
|
||||
filename,
|
||||
f'Invalid length definition "{l_len}" for vendor {vendor_name}',
|
||||
@@ -399,7 +399,7 @@ class Dictionary:
|
||||
def _parse_attribute(self, tokens: Sequence[str], line_num: int):
|
||||
"""Parse an ATTRIBUTE line of (Free)RADIUS dictionaries."""
|
||||
filename = self.filestack[-1]
|
||||
if not len(tokens) in {4, 5}:
|
||||
if not len(tokens) in [4, 5]:
|
||||
raise ParseError(
|
||||
filename,
|
||||
"Incorrect number of tokens for attribute definition",
|
||||
@@ -410,7 +410,7 @@ class Dictionary:
|
||||
name, attr_code, datatype = tokens[1:4]
|
||||
|
||||
if (
|
||||
datatype in {"concat", "extended", "evs", "long-extended"}
|
||||
datatype in ["concat", "extended", "evs", "long-extended"]
|
||||
and self.cur_vendor != self.rfc_vendor
|
||||
):
|
||||
raise ParseError(
|
||||
|
||||
Reference in New Issue
Block a user