Remove None handling from fields.get_attribute()

This commit is contained in:
Ryan P Kilby 2017-08-30 14:15:33 -04:00
parent 94e5d05caa
commit 07258ca032

View File

@ -93,9 +93,6 @@ def get_attribute(instance, attrs):
Also accepts either attribute lookup on objects or dictionary lookups.
"""
for attr in attrs:
if instance is None:
# Break out early if we get `None` at any point in a nested lookup.
return None
try:
if isinstance(instance, collections.Mapping):
instance = instance[attr]