Skip to content

Commit

Permalink
seq_parser minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maximdanilchenko committed Nov 8, 2023
1 parent f3721df commit 2c2c7e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aiochclient/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ def seq_parser(cls, raw: str) -> Generator[str, None, None]:
Generator for parsing tuples and arrays.
Returns elements one by one
"""
if not raw:
return None
cur = []
in_str = False
in_arr = False
in_tup = False
escape_char = False
if not raw:
return None
for sym in raw:
if not (in_str or in_arr or in_tup):
if sym == cls.CM:
yield "".join(cur)
cur = []
cur.clear()
continue
elif sym == cls.DQ:
in_str = not in_str
Expand Down Expand Up @@ -326,7 +326,7 @@ def p_type(self, string: Any) -> dict:
for key, val in string.items()
}

def convert(self, value: bytes) -> list:
def convert(self, value: bytes) -> dict:
return self.p_type(value.decode())

@staticmethod
Expand Down

0 comments on commit 2c2c7e6

Please sign in to comment.