Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-defined exception handlers set via sys.excepthook not executed in Ghidrathon #102

Open
fariss opened this issue Apr 29, 2024 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fariss
Copy link
Contributor

fariss commented Apr 29, 2024

User custom exception hooks set via sys.excepthook = <custom exception handler> are not executed in Ghidrathon. Though, this functionally works as intended in the builtin interpreter. See #101 (comment)

To repoduce this issue:

def my_exc_handler(type, value, traceback):
    print("This is a custom exception handler...")
    
import sys
sys.excepthook = my_exc_handler
raise Exception
@fariss
Copy link
Contributor Author

fariss commented Apr 29, 2024

A potential fix for this issue in jepeval.py and jeprunscript.py could look something like this:

# Check if a custom exception hook has been set
if sys.excepthook != sys.__excepthook__:
    # Call the custom exception hook
    sys.excepthook(type(err), err, err.__traceback__)

@mike-hunhoff mike-hunhoff added good first issue Good for newcomers help wanted Extra attention is needed labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants