Skip to content

Commit

Permalink
fix intermittent recursion depth exception / SIGABRT in CI, fixes #189
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud committed Aug 11, 2020
1 parent 81846f0 commit f85bff6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion glom/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ def _unpack_stack(scope):
if branches == [child]:
branches = [] # if there's only one branch, count it as linear
stack.append([scope, scope[Spec], scope[T], scope.get(CUR_ERROR), branches])
if child in branches:

# NB: this id() business is necessary to avoid a
# nondeterministic bug in abc's __eq__ see #189 for details
if id(child) in [id(b) for b in branches]:
break # if child already covered by branches, stop the linear descent

scope = child.maps[0]
else: # if break executed above, cur scope was already added
stack.append([scope, scope[Spec], scope[T], scope.get(CUR_ERROR), []])
Expand Down

1 comment on commit f85bff6

@kurtbrose
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

Please sign in to comment.