mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
check if the tag is a dict
This commit is contained in:
parent
0098c973af
commit
55804c8c1d
1 changed files with 3 additions and 1 deletions
|
@ -403,13 +403,15 @@ def import_json_string(json_string, verbose=True, full_output=False):
|
||||||
if isinstance(o.get('tag'), list): # supports the old way
|
if isinstance(o.get('tag'), list): # supports the old way
|
||||||
taglist = o.get('tag') # This had to be modified to get the taglist from the dictionary
|
taglist = o.get('tag') # This had to be modified to get the taglist from the dictionary
|
||||||
temp_prange = None
|
temp_prange = None
|
||||||
else:
|
elif isinstance(o.get('tag'), dict):
|
||||||
tagdic = o.get('tag')
|
tagdic = o.get('tag')
|
||||||
taglist = tagdic['tag']
|
taglist = tagdic['tag']
|
||||||
if 'prange' in tagdic:
|
if 'prange' in tagdic:
|
||||||
temp_prange = tagdic['prange']
|
temp_prange = tagdic['prange']
|
||||||
else:
|
else:
|
||||||
temp_prange = None
|
temp_prange = None
|
||||||
|
else:
|
||||||
|
raise Exception ("The tag is not a list or dict")
|
||||||
|
|
||||||
corr_tag = taglist[-1]
|
corr_tag = taglist[-1]
|
||||||
tmp_o = o
|
tmp_o = o
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue