Ensure we don't ever get in a loop looking up ._vol (could happen when pickling/unpickling).

This commit is contained in:
Mike Auty
2016-12-25 00:02:11 +00:00
parent d51dd2a992
commit e230bbf6a8
+3 -2
View File
@@ -176,8 +176,9 @@ class Template(validity.ValidityRoutines):
def __getattr__(self, attr):
"""Exposes any other values stored in ._vol as attributes (for example, enumeration choices)"""
if attr in self._vol:
return self._vol[attr]
if attr != '_vol':
if attr in self._vol:
return self._vol[attr]
raise AttributeError("{} object has no attribute {}".format(self.__class__.__name__, attr))
def __call__(self, context, object_info):