Skip to content

Commit

Permalink
Change to skip
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylion007 committed Jul 27, 2021
1 parent 11f14f7 commit fb6b064
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions include/pybind11/functional.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ struct type_caster<std::function<Return(Args...)>> {
rec = rec->next;
}
}
// PYPY segfaults here when passing builtin function like sum.
// Raising an fail exception here works to prevent the segfault, but only on gcc.
// TODO debug PyPy segfault or figure out a way to raise an error on PyPy on all platforms,.

This comment has been minimized.

Copy link
@rwgk

rwgk Jul 27, 2021

Collaborator

I'd delete this line unless you're determined & committed to do the work (I wouldn't; I'd leave this for someone who actually needs this to work (if any!)).
Maybe:
// See PR #1413 for full background.

// See PR #1413
}

// ensure GIL is held during functor destruction
Expand Down
5 changes: 2 additions & 3 deletions tests/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ def test_movable_object():
assert m.callback_with_movable(lambda _: None) is True


@pytest.mark.xfail(
@pytest.mark.skip(
"env.PYPY",
reason="We raise an error to avoid a segfault in PyPy.",
raises=TypeError,
reason="PyPy segfaults on here. See discussion on #1413.",
)
def test_python_builtins():
"""Test if python builtins like sum() can be used as callbacks"""
Expand Down

0 comments on commit fb6b064

Please sign in to comment.