Better error message for from_tree
This commit is contained in:
parent
2884f9fff8
commit
39f348244d
@ -154,10 +154,18 @@ class Qube:
|
|||||||
# Add to the dictionary at current stack level
|
# Add to the dictionary at current stack level
|
||||||
parent = stack[-1]
|
parent = stack[-1]
|
||||||
key = list(current.keys())[0]
|
key = list(current.keys())[0]
|
||||||
|
if key in parent:
|
||||||
|
raise ValueError(
|
||||||
|
f"This function doesn't yet support reading in uncompressed trees, repeated key is {key}"
|
||||||
|
)
|
||||||
parent[key] = current[key]
|
parent[key] = current[key]
|
||||||
else:
|
else:
|
||||||
# Top level
|
# Top level
|
||||||
key = list(current.keys())[0]
|
key = list(current.keys())[0]
|
||||||
|
if root:
|
||||||
|
raise ValueError(
|
||||||
|
f"This function doesn't yet support reading in uncompressed trees, repeated key is {key}"
|
||||||
|
)
|
||||||
root = current[key]
|
root = current[key]
|
||||||
|
|
||||||
# Push to the stack
|
# Push to the stack
|
||||||
|
Loading…
x
Reference in New Issue
Block a user