Skip to content

Commit 60da939

Browse files
godlygeekpablogsal
authored andcommitted
Mark our Cython logging handler as noexcept
This is called from C++ code that doesn't know how to propagate a Python exception if one should occur. Tell Cython not to allow an exception to escape from this function, and to instead print and discard one if it should occur. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
1 parent 4ddd2dc commit 60da939

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pystack/_pystack.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class NativeReportingMode(enum.Enum):
8787
ALL = 1000
8888

8989

90-
cdef api void log_with_python(const char* message, int level):
90+
cdef api void log_with_python(const char* message, int level) noexcept:
9191
with contextlib.suppress(UnicodeDecodeError):
9292
LOGGER.log(level, message)
9393

0 commit comments

Comments
 (0)