Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def read_toml(content):
check_section_header(content)
for k, v in toml.loads(content, collections.OrderedDict).items():
if len(v.values()) and isinstance(list(v.values())[0], dict):
raise RuntimeError('malformed section header -- forgot quotes?', k)
pname, version = split_name(k)
yield WhitelistRule(pname=pname, version=version, **v)