fix exception in unrepr on empty dict/tuple
This commit is contained in:
parent
ac3f96eac9
commit
fec78f8781
|
@ -430,6 +430,8 @@ Please specify account for sending the message.') % sys.argv[2])
|
||||||
return (_str, value[substr_len :])
|
return (_str, value[substr_len :])
|
||||||
elif first_char == '{': # dict
|
elif first_char == '{': # dict
|
||||||
_dict = {}
|
_dict = {}
|
||||||
|
if value[1] == '}':
|
||||||
|
return ({}, value[2:])
|
||||||
while True:
|
while True:
|
||||||
if value[1] == '}':
|
if value[1] == '}':
|
||||||
break
|
break
|
||||||
|
@ -453,6 +455,8 @@ Please specify account for sending the message.') % sys.argv[2])
|
||||||
return (_dict, next[1:])
|
return (_dict, next[1:])
|
||||||
elif first_char in ['[', '(']: # return list
|
elif first_char in ['[', '(']: # return list
|
||||||
_tuple = []
|
_tuple = []
|
||||||
|
if value[1] == ']':
|
||||||
|
return ([], value[2:])
|
||||||
while True:
|
while True:
|
||||||
if value[1] == ']':
|
if value[1] == ']':
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue