Commit e3c0d5eb authored by Guido van Rossum's avatar Guido van Rossum

Added new Py_IsInitalized() API function to test the 'initialized' flag.

parent 779133c7
...@@ -42,6 +42,7 @@ char *Py_GetProgramName Py_PROTO((void)); ...@@ -42,6 +42,7 @@ char *Py_GetProgramName Py_PROTO((void));
void Py_Initialize Py_PROTO((void)); void Py_Initialize Py_PROTO((void));
void Py_Finalize Py_PROTO((void)); void Py_Finalize Py_PROTO((void));
int Py_IsInitialized Py_PROTO((void));
PyThreadState *Py_NewInterpreter Py_PROTO((void)); PyThreadState *Py_NewInterpreter Py_PROTO((void));
void Py_EndInterpreter Py_PROTO((PyThreadState *)); void Py_EndInterpreter Py_PROTO((PyThreadState *));
......
...@@ -220,6 +220,8 @@ EXPORTS ...@@ -220,6 +220,8 @@ EXPORTS
Py_FatalError Py_FatalError
Py_Exit Py_Exit
Py_Initialize Py_Initialize
Py_Finalize
Py_IsInitialized
PyErr_Print PyErr_Print
PyParser_SimpleParseFile PyParser_SimpleParseFile
PyParser_SimpleParseString PyParser_SimpleParseString
......
...@@ -78,6 +78,14 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ ...@@ -78,6 +78,14 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
static int initialized = 0; static int initialized = 0;
/* API to access the initialized flag -- useful for eroteric use */
int
Py_IsInitialized()
{
return initialized;
}
/* Global initializations. Can be undone by Py_Finalize(). Don't /* Global initializations. Can be undone by Py_Finalize(). Don't
call this twice without an intervening Py_Finalize() call. When call this twice without an intervening Py_Finalize() call. When
initializations fail, a fatal error is issued and the function does initializations fail, a fatal error is issued and the function does
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment