Skip to content

Commit

Permalink
If not merging then don't keep self as a previous tracer. Closes #16.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Sep 21, 2015
1 parent db320e1 commit 2952b5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hunter.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ def trace(self, *predicates, **options):
predicate = Q(*predicates, **options)

previous_tracer = sys.gettrace()
if previous_tracer is self and merge:
self._handler |= predicate
if previous_tracer is self:
if merge:
self._handler |= predicate
else:
self._previous_tracer = previous_tracer
self._handler = predicate
Expand Down

0 comments on commit 2952b5b

Please sign in to comment.