Open xiaxinmeng opened 1 year ago
This looks like unchecked type assertions...
https://github.com/go-python/gpython/blob/6f8e06a4660709ab44398d8b1a18738aa407b1c3/py/import.go#L356
In fact we should probably just be catching these and turning them into a TypeError as there are loads of them in the code base.
I see in 4b9bdd5ab64c6869fdbeb5577c4e2665839787b5 we removed those checks. Maybe we need to put some of them back. Perhaps just the one in CALL_FUNCTION
'import' takes incorrect arguments and it crashes gpython. we test the following code on Gopherjs and Go/wasm online.
test.py
__import__( 'pkg', {}, {}, [''] )
Output on GO/wasm(https://gpython.org/?wasm):
Output on Gopherjs (https://gpython.org/)