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
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user