Minor refactoring for nested try-block
A minor refactoring for unnecessary try-block nesting. TrivialFix Change-Id: I8bfb2ff10f802594769a53c9c90a47ae21af1f22
This commit is contained in:
@@ -490,15 +490,14 @@ class Resource(RequestIdMixin):
|
|||||||
|
|
||||||
def _add_details(self, info):
|
def _add_details(self, info):
|
||||||
for (k, v) in six.iteritems(info):
|
for (k, v) in six.iteritems(info):
|
||||||
try:
|
|
||||||
try:
|
try:
|
||||||
setattr(self, k, v)
|
setattr(self, k, v)
|
||||||
|
except AttributeError:
|
||||||
|
# In this case we already defined the attribute on the class
|
||||||
|
continue
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
pass
|
pass
|
||||||
self._info[k] = v
|
self._info[k] = v
|
||||||
except AttributeError:
|
|
||||||
# In this case we already defined the attribute on the class
|
|
||||||
pass
|
|
||||||
|
|
||||||
def __getattr__(self, k):
|
def __getattr__(self, k):
|
||||||
if k not in self.__dict__ or k not in self._info:
|
if k not in self.__dict__ or k not in self._info:
|
||||||
|
Reference in New Issue
Block a user