]> granicus.if.org Git - python/commitdiff
Added new Py_IsInitalized() API function to test the 'initialized' flag.
authorGuido van Rossum <guido@python.org>
Fri, 22 Aug 1997 04:20:13 +0000 (04:20 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 22 Aug 1997 04:20:13 +0000 (04:20 +0000)
Include/pythonrun.h
PC/python_nt.def
Python/pythonrun.c

index 09d3b57e8a733fc7f1f2af17e632f864429730f5..7d4f05607855103d39c9c7257bee879eefa8b6bc 100644 (file)
@@ -42,6 +42,7 @@ char *Py_GetProgramName Py_PROTO((void));
 
 void Py_Initialize Py_PROTO((void));
 void Py_Finalize Py_PROTO((void));
+int Py_IsInitialized Py_PROTO((void));
 PyThreadState *Py_NewInterpreter Py_PROTO((void));
 void Py_EndInterpreter Py_PROTO((PyThreadState *));
 
index 786d072dc8535f7f1105561dc66fbd86e5632627..2e4010841a0cebcd1cef7423fa6eaa0e2b2c6b1a 100644 (file)
@@ -220,6 +220,8 @@ EXPORTS
        Py_FatalError
        Py_Exit
        Py_Initialize
+       Py_Finalize
+       Py_IsInitialized
        PyErr_Print
        PyParser_SimpleParseFile
        PyParser_SimpleParseString
index 9f977f05b43247056aa25a667cc3c9127afe552d..22cb86bdca9b49975cd8926858417bc59c342e33 100644 (file)
@@ -78,6 +78,14 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
 
 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
    call this twice without an intervening Py_Finalize() call.  When
    initializations fail, a fatal error is issued and the function does