Permalink
Browse files

Some more graceful handling of logging with only .pyc available

  • Loading branch information...
1 parent 7b42236 commit 2d0e5c3ef634499cb4e3b7c1750186023e557ebf @eallik committed Jan 7, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 spinoff/util/logging.py
View
@@ -233,8 +233,8 @@ def _do_write(level, *args, **kwargs):
elif caller_fn:
caller_fn._r_logstring = logstring
- logname = getattr(caller, '_r_logname', None)
- if not logname:
+ logname = getattr(caller, '_r_logname', None) if caller else ''
+ if logname is None:
logname = CYAN + get_logname(caller) + RESET_COLOR
if not hasattr(caller, '__slots__'):
caller._r_logname = logname

0 comments on commit 2d0e5c3

Please sign in to comment.