Patch #900727: Add Py_InitializeEx to allow embedding without signals.
This commit is contained in:
parent
4d4dfb7a2b
commit
336e85f56a
|
@ -23,6 +23,13 @@
|
||||||
no return value; it is a fatal error if the initialization fails.
|
no return value; it is a fatal error if the initialization fails.
|
||||||
\end{cfuncdesc}
|
\end{cfuncdesc}
|
||||||
|
|
||||||
|
\begin{cfuncdesc}{void}{Py_InitializeEx}{int initsigs}
|
||||||
|
This function works like \cfunction{Py_Initialize} if
|
||||||
|
\var{initsigs} is 1. If \var{initsigs} is 0, it skips
|
||||||
|
initialization registration of signal handlers, which
|
||||||
|
might be useful when Python is embedded. \versionadded{2.4}
|
||||||
|
\end{cfuncdesc}
|
||||||
|
|
||||||
\begin{cfuncdesc}{int}{Py_IsInitialized}{}
|
\begin{cfuncdesc}{int}{Py_IsInitialized}{}
|
||||||
Return true (nonzero) when the Python interpreter has been
|
Return true (nonzero) when the Python interpreter has been
|
||||||
initialized, false (zero) if not. After \cfunction{Py_Finalize()}
|
initialized, false (zero) if not. After \cfunction{Py_Finalize()}
|
||||||
|
|
|
@ -23,6 +23,7 @@ PyAPI_FUNC(void) Py_SetPythonHome(char *);
|
||||||
PyAPI_FUNC(char *) Py_GetPythonHome(void);
|
PyAPI_FUNC(char *) Py_GetPythonHome(void);
|
||||||
|
|
||||||
PyAPI_FUNC(void) Py_Initialize(void);
|
PyAPI_FUNC(void) Py_Initialize(void);
|
||||||
|
PyAPI_FUNC(void) Py_InitializeEx(int);
|
||||||
PyAPI_FUNC(void) Py_Finalize(void);
|
PyAPI_FUNC(void) Py_Finalize(void);
|
||||||
PyAPI_FUNC(int) Py_IsInitialized(void);
|
PyAPI_FUNC(int) Py_IsInitialized(void);
|
||||||
PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
|
PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
|
||||||
|
|
|
@ -12,6 +12,8 @@ What's New in Python 2.4 alpha 3?
|
||||||
Core and builtins
|
Core and builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Py_InitializeEx has been added.
|
||||||
|
|
||||||
- Fix the order of application of decorators. The proper order is bottom-up;
|
- Fix the order of application of decorators. The proper order is bottom-up;
|
||||||
the first decorator listed is the last one called.
|
the first decorator listed is the last one called.
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ add_flag(int flag, const char *envs)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Py_Initialize(void)
|
Py_InitializeEx(int install_sigs)
|
||||||
{
|
{
|
||||||
PyInterpreterState *interp;
|
PyInterpreterState *interp;
|
||||||
PyThreadState *tstate;
|
PyThreadState *tstate;
|
||||||
|
@ -208,6 +208,7 @@ Py_Initialize(void)
|
||||||
|
|
||||||
_PyImportHooks_Init();
|
_PyImportHooks_Init();
|
||||||
|
|
||||||
|
if (install_sigs)
|
||||||
initsigs(); /* Signal handling stuff, including initintr() */
|
initsigs(); /* Signal handling stuff, including initintr() */
|
||||||
|
|
||||||
initmain(); /* Module __main__ */
|
initmain(); /* Module __main__ */
|
||||||
|
@ -276,6 +277,13 @@ Py_Initialize(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Py_Initialize(void)
|
||||||
|
{
|
||||||
|
Py_InitializeEx(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef COUNT_ALLOCS
|
#ifdef COUNT_ALLOCS
|
||||||
extern void dump_counts(void);
|
extern void dump_counts(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue