fix(python): catch BaseException in wrappers instead of Exception (#2163)
Some checks are pending
Crate 📦 Distribution / ${{ matrix.config.name }} (map[arch:x64 name:Ubuntu x86_64 os:ubuntu-latest]) (push) Waiting to run
Crate 📦 Distribution / ${{ matrix.config.name }} (map[arch:x64 name:Windows x86_64 os:windows-2022]) (push) Waiting to run
Crate 📦 Distribution / ${{ matrix.config.name }} (map[arch:x64 name:macOS x86_64 os:macos-latest]) (push) Waiting to run
Crate 📦 Distribution / ${{ matrix.config.name }} (map[arch:x86 name:Windows x86 os:windows-2022]) (push) Waiting to run
Zig Build / build-ubuntu (ubuntu-latest) (push) Waiting to run
Zig Build / build-macos (macos-latest) (push) Waiting to run

This commit is contained in:
Amaan Qureshi
2025-04-14 01:33:51 -04:00
committed by GitHub
parent acb638c40a
commit fd1bf224e9
2 changed files with 2 additions and 2 deletions

View File

@@ -390,7 +390,7 @@ def _catch_hook_exception(func):
"""
try:
return func(self, *args, **kwargs)
except Exception as e:
except BaseException as e:
# If multiple hooks raise exceptions, just use the first one
if self._hook_exception is None:
self._hook_exception = e

View File

@@ -361,7 +361,7 @@ def uccallback(uc: Uc, functype: Type[_CFP]):
def wrapper(handle: int, *args, **kwargs):
try:
return func(uc, *args, **kwargs)
except Exception as e:
except BaseException as e:
# If multiple hooks raise exceptions, just use the first one
if uc._hook_exception is None:
uc._hook_exception = e