Commit 8efc7ed1 authored by Nic's avatar Nic
Browse files

make gsource OK for python<3.8

parent 5f86bb4d
......@@ -552,9 +552,16 @@ class ValidatorMixin:
otherwise, the whole dict is returned
"""
props = self.get(tabname, "schemas").build()["properties"]
units = {
dim: units for dim, data in props.items() if (units := data.get("units"))
}
# python >= 3.8 only
# units = {
# dim: units for dim, data in props.items() if (units := data.get("units"))
# }
units = {}
for dim, data in props.items():
_units = data.get("units")
if _units:
units[dim] = _units
if key:
return units[key]
return units
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment