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

func_timeout.dafunc.FunctionTimedOut{hash} exceptions #16

Open
CyL0NG opened this issue Nov 13, 2020 · 1 comment
Open

func_timeout.dafunc.FunctionTimedOut{hash} exceptions #16

CyL0NG opened this issue Nov 13, 2020 · 1 comment

Comments

@CyL0NG
Copy link

CyL0NG commented Nov 13, 2020

I use func_timeout with python 3.6.9,sometimes it will produce many func_timeout.dafunc.FunctionTimedOut{hash} exceptions.
image
image。Normally I can not catch this exception,In python 3.6.9, use sys.excepthook could get the error.
In python 3.8.6,sys.excepthook do not work.
image

And I don't know why this exception happened.

@Macr0phag3
Copy link

Macr0phag3 commented Feb 23, 2021

@CyL0NG

remove hash function to solve it:

vim site-packages/func_timeout/dafunc.py, line 96

# FunctionTimedOutTemp = type('FunctionTimedOut' + str( hash( "%d_%d_%d_%d" %(id(timeout), id(func), id(args), id(kwargs)))) ), FunctionTimedOutTempType.__bases__, dict(FunctionTimedOutTempType.__dict__))
FunctionTimedOutTemp = type(
    'FunctionTimedOut',
    FunctionTimedOutTempType.__bases__,
    dict(FunctionTimedOutTempType.__dict__)
)

⚠️: I haven't read the source code completely, so use it carefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants