Merge "Minor refactoring for nested try-block"
This commit is contained in:
@@ -491,14 +491,13 @@ class Resource(RequestIdMixin):
|
|||||||
def _add_details(self, info):
|
def _add_details(self, info):
|
||||||
for (k, v) in info.items():
|
for (k, v) in info.items():
|
||||||
try:
|
try:
|
||||||
try:
|
setattr(self, k, v)
|
||||||
setattr(self, k, v)
|
|
||||||
except UnicodeEncodeError:
|
|
||||||
pass
|
|
||||||
self._info[k] = v
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# In this case we already defined the attribute on the class
|
# In this case we already defined the attribute on the class
|
||||||
|
continue
|
||||||
|
except UnicodeEncodeError:
|
||||||
pass
|
pass
|
||||||
|
self._info[k] = v
|
||||||
|
|
||||||
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