Skip to content

Commit

Permalink
Fixes infinite recursion when logger_isa receives patched logger object
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Apr 13, 2015
1 parent 63f6c98 commit af3e046
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions celery/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def in_sighandler():
set_in_sighandler(False)


def logger_isa(l, p):
def logger_isa(l, p, max=1000):
this, seen = l, set()
while this:
for _ in range(max):
if this == p:
return True
else:
Expand All @@ -89,6 +89,10 @@ def logger_isa(l, p):
)
seen.add(this)
this = this.parent
if not this:
break
else:
raise RuntimeError('Logger hierarchy exceeds {0}'.format(max))
return False


Expand Down

0 comments on commit af3e046

Please sign in to comment.