Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
336e85f5
Commit
336e85f5
authored
Aug 19, 2004
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #900727: Add Py_InitializeEx to allow embedding without signals.
parent
4d4dfb7a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
Doc/api/init.tex
Doc/api/init.tex
+7
-0
Include/pythonrun.h
Include/pythonrun.h
+1
-0
Misc/NEWS
Misc/NEWS
+2
-0
Python/pythonrun.c
Python/pythonrun.c
+10
-2
No files found.
Doc/api/init.tex
View file @
336e85f5
...
...
@@ -23,6 +23,13 @@
no return value; it is a fatal error if the initialization fails.
\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
}{}
Return true (nonzero) when the Python interpreter has been
initialized, false (zero) if not. After
\cfunction
{
Py
_
Finalize()
}
...
...
Include/pythonrun.h
View file @
336e85f5
...
...
@@ -23,6 +23,7 @@ PyAPI_FUNC(void) Py_SetPythonHome(char *);
PyAPI_FUNC
(
char
*
)
Py_GetPythonHome
(
void
);
PyAPI_FUNC
(
void
)
Py_Initialize
(
void
);
PyAPI_FUNC
(
void
)
Py_InitializeEx
(
int
);
PyAPI_FUNC
(
void
)
Py_Finalize
(
void
);
PyAPI_FUNC
(
int
)
Py_IsInitialized
(
void
);
PyAPI_FUNC
(
PyThreadState
*
)
Py_NewInterpreter
(
void
);
...
...
Misc/NEWS
View file @
336e85f5
...
...
@@ -12,6 +12,8 @@ What's New in Python 2.4 alpha 3?
Core and builtins
-----------------
- Py_InitializeEx has been added.
- Fix the order of application of decorators. The proper order is bottom-up;
the first decorator listed is the last one called.
...
...
Python/pythonrun.c
View file @
336e85f5
...
...
@@ -131,7 +131,7 @@ add_flag(int flag, const char *envs)
}
void
Py_Initialize
(
void
)
Py_Initialize
Ex
(
int
install_sigs
)
{
PyInterpreterState
*
interp
;
PyThreadState
*
tstate
;
...
...
@@ -208,6 +208,7 @@ Py_Initialize(void)
_PyImportHooks_Init
();
if
(
install_sigs
)
initsigs
();
/* Signal handling stuff, including initintr() */
initmain
();
/* Module __main__ */
...
...
@@ -276,6 +277,13 @@ Py_Initialize(void)
#endif
}
void
Py_Initialize
(
void
)
{
Py_InitializeEx
(
1
);
}
#ifdef COUNT_ALLOCS
extern
void
dump_counts
(
void
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment