Do not double pl.exception() call, record used pl in variable instead

This commit is contained in:
ZyX 2013-11-17 16:40:15 +04:00
parent 5bb32fadce
commit a06fe3ad5f
1 changed files with 2 additions and 5 deletions

View File

@ -488,8 +488,5 @@ class Powerline(object):
def exception(self, msg, *args, **kwargs):
if 'prefix' not in kwargs:
kwargs['prefix'] = 'powerline'
try:
return self.pl.exception(msg, *args, **kwargs)
except AttributeError:
pl = _get_fallback_logger()
return pl.exception(msg, *args, **kwargs)
pl = getattr(self, 'pl', None) or _get_fallback_logger()
return pl.exception(msg, *args, **kwargs)