Fix intify_attrs function for obsolete data

This commit is contained in:
Matthew Honnibal 2019-03-07 21:59:03 +01:00
parent 987ee6e884
commit dd9ea478c5
1 changed files with 5 additions and 1 deletions

View File

@ -143,8 +143,12 @@ def intify_attrs(stringy_attrs, strings_map=None, _do_deprecated=False):
for name, value in stringy_attrs.items(): for name, value in stringy_attrs.items():
if isinstance(name, int): if isinstance(name, int):
int_key = name int_key = name
else: elif name in IDS:
int_key = IDS[name]
elif name.upper() in IDS:
int_key = IDS[name.upper()] int_key = IDS[name.upper()]
else:
continue
if strings_map is not None and isinstance(value, basestring): if strings_map is not None and isinstance(value, basestring):
if hasattr(strings_map, 'add'): if hasattr(strings_map, 'add'):
value = strings_map.add(value) value = strings_map.add(value)