bpo-38858: Fix Py_Finalize() when called from a subinterpreter (GH-17297)

Use _Py_IsMainInterpreter() in Py_Initialize() and Py_Finalize() to
detect if the current interpreter is the main interpreter or not.
1 file changed