DataDog / go-python3

Go bindings to the CPython-3 API
MIT License
376 stars 140 forks source link

Fix PyModule_GetState #50

Closed M-Quadra closed 2 years ago

M-Quadra commented 2 years ago

What does this PR do?

Fix PyModule_GetState.

Motivation

This should be C.PyModule_GetState, not C.PyModule_GetNameObject.

In the test, assert.NotNil don' t support unsafe.Pointer(nil). It will pass the assert.

Additional Notes

PyModuleDef.m_size is -1 in many modules. They will return nil after calling PyModule_GetState.

christian-korneck commented 2 years ago

as this project will be archived soon, feel free to submit your PR to our community fork go-python/cpy3 and we'll review it.