Skip to content

Commit fd1bf22

Browse files
authored
fix(python): catch BaseException in wrappers instead of Exception (#2163)
1 parent acb638c commit fd1bf22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bindings/python/unicorn/unicorn_py2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def wrapper(self, *args, **kwargs):
390390
"""
391391
try:
392392
return func(self, *args, **kwargs)
393-
except Exception as e:
393+
except BaseException as e:
394394
# If multiple hooks raise exceptions, just use the first one
395395
if self._hook_exception is None:
396396
self._hook_exception = e

bindings/python/unicorn/unicorn_py3/unicorn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def decorate(func) -> _CFP:
361361
def wrapper(handle: int, *args, **kwargs):
362362
try:
363363
return func(uc, *args, **kwargs)
364-
except Exception as e:
364+
except BaseException as e:
365365
# If multiple hooks raise exceptions, just use the first one
366366
if uc._hook_exception is None:
367367
uc._hook_exception = e

0 commit comments

Comments
 (0)