Skip to content

Commit

Permalink
Fix #385
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Dec 8, 2023
1 parent 4418940 commit d14f7dc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
3.0.2 (unreleased)
==================

- Nothing changed yet.
- Fix a test case on Arm32. Note that this is not a supported platform
(there is no CI for it) and support is best effort; there may be
other issues lurking. See `issue 385 <https://github.com/python-greenlet/greenlet/issues/385>`_


3.0.1 (2023-10-25)
Expand Down
6 changes: 5 additions & 1 deletion src/greenlet/TUserGreenlet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,11 @@ UserGreenlet::g_initialstub(void* mark)
// Getting a C++ exception here isn't good. It's probably a
// bug in the underlying greenlet, meaning it's probably a
// C++ extension. We're going to abort anyway, but try to
// display some nice information if possible.
// display some nice information *if* possible. Some obscure
// platforms don't properly support this (old 32-bit Arm, see see
// https://github.com/python-greenlet/greenlet/issues/385); that's not
// great, but should usually be OK because, as mentioned above, we're
// terminating anyway.
//
// The catching is tested by
// ``test_cpp.CPPTests.test_unhandled_exception_in_greenlet_aborts``.
Expand Down
6 changes: 5 additions & 1 deletion src/greenlet/tests/test_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ def test_unhandled_std_exception_as_greenlet_function_aborts(self):
# verify that plain unhandled throw aborts
output = self._do_test_unhandled_exception('run_as_greenlet_target')
self.assertIn(
'greenlet: Unhandled C++ exception: Thrown from an extension.',
# We really expect this to be prefixed with "greenlet: Unhandled C++ exception:"
# as added by our handler for std::exception (see TUserGreenlet.cpp), but
# that's not correct everywhere --- our handler never runs before std::terminate
# gets called (for example, on arm32).
'Thrown from an extension.',
output
)

Expand Down

0 comments on commit d14f7dc

Please sign in to comment.