We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following test leaks memory:
it('catching JS exceptions propagated through Python', () => { const fn = PyObject.fromJS(() => { throw new Error('JS exception'); }); assert.isTrue(fn.callable); assert.equal(fn.type, 'pymport.js_function'); const py_catch = pymport('python_helpers').get('dont_catch_exception'); assert.throws(() => { py_catch.call(fn); }, /Python exception: JS exception/); });
The text was updated successfully, but these errors were encountered:
Happens only with the fastcall protocol on Python > 3.9 V8 does not garbage collect fn
fn
Sorry, something went wrong.
This test does not have the leak:
it'catching JS exceptions propagated through Python', () => { const fn = PyObject.fromJS(() => { throw new Error('JS exception'); }); assert.isTrue(fn.callable); assert.equal(fn.type, 'pymport.js_function'); const py_dont_catch = pymport('python_helpers').get('dont_catch_exception'); try { py_dont_catch.call(fn); } catch { } });
However this one does:
it('catching JS exceptions propagated through Python', () => { const fn = PyObject.fromJS(() => { throw new Error('JS exception'); }); assert.isTrue(fn.callable); assert.equal(fn.type, 'pymport.js_function'); const py_dont_catch = pymport('python_helpers').get('dont_catch_exception'); try { (() => { py_dont_catch.call(fn); })(); } catch (e: any) { assert.match(e.toString(), /Python exception: JS exception/); } });
No branches or pull requests
The following test leaks memory:
The text was updated successfully, but these errors were encountered: