Skip to content

Commit 838d614

Browse files
committed
Update
1 parent 2c118ce commit 838d614

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

aiochclient/_types.pyx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ cdef class StrType:
174174
self.container = container
175175

176176
cdef str _convert(self, str string):
177+
string = decode(string.encode())
177178
if self.container:
178179
return remove_single_quotes(string)
179180
return string
@@ -524,7 +525,7 @@ cdef class TupleType:
524525

525526
cdef tuple _convert(self, str string):
526527
return tuple(
527-
tp(decode(val.encode()))
528+
tp(val)
528529
for tp, val in zip(self.types, seq_parser(string[1:-1]))
529530
)
530531

@@ -554,7 +555,7 @@ cdef class MapType:
554555
cdef dict _convert(self, str string):
555556
key, value = string[1:-1].split(':', 1)
556557
return {
557-
self.key_type.p_type(decode(key.encode())): self.value_type.p_type(decode(value.encode()))
558+
self.key_type.p_type(key): self.value_type.p_type(value)
558559
}
559560

560561
cpdef dict p_type(self, string):
@@ -579,7 +580,7 @@ cdef class ArrayType:
579580
)
580581

581582
cdef list _convert(self, str string):
582-
return [self.type.p_type(decode(val.encode())) for val in seq_parser(string[1:-1])]
583+
return [self.type.p_type(val) for val in seq_parser(string[1:-1])]
583584

584585
cpdef list p_type(self, str string):
585586
return self._convert(string)
@@ -611,7 +612,7 @@ cdef class NestedType:
611612
for val in seq_parser(string[1:-1]):
612613
temp = []
613614
for tp, elem in zip(self.types, seq_parser(val.strip("()"))):
614-
temp.append(tp.p_type(decode(elem.encode())))
615+
temp.append(tp.p_type(elem))
615616
result.append(tuple(temp))
616617
return result
617618

0 commit comments

Comments
 (0)