I have a C++ app that uses Python to load some scripts. It calls some functions in the scripts, and everything works fine until the app exits and calls Py_Finalize. Then it displays the following: (GetName is a function in one of the scripts)
Exception AttributeError: “‘module’ object has no attribute ‘GetName'” in ‘garbage collection’ ignored
Fatal Python error: unexpected exception during garbage collection
Then the app crashes.
I’m using Python 3.1 on Windows. Any advice would be appreciated.
From the docs to Py_Finalize():
Most likely a
__del__contains a call to<somemodule>.GetName(), but that module has already been destroyed by the time__del__is called.