Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
d59dbe68
Commit
d59dbe68
authored
Feb 26, 2019
by
Jan Möbius
Browse files
Added some more debug
parent
e950de59
Changes
1
Hide whitespace changes
Inline
Side-by-side
PythonInterpreter/PythonInterpreter.cc
View file @
d59dbe68
...
...
@@ -102,21 +102,34 @@ bool PythonInterpreter::modulesInitialized() {
}
void
PythonInterpreter
::
initPython
()
{
if
(
Py_IsInitialized
()
)
if
(
Py_IsInitialized
()
)
{
#ifdef PYTHON_DEBUG
std
::
cerr
<<
"Python already Initialized!"
<<
std
::
endl
;
#endif
return
;
}
#ifdef PYTHON_DEBUG
std
::
cerr
<<
"Initialize interpreter ... "
;
#endif
std
::
cerr
<<
"A"
<<
std
::
endl
;
py
::
initialize_interpreter
();
std
::
cerr
<<
"B"
<<
std
::
endl
;
#ifdef PYTHON_DEBUG
std
::
cerr
<<
" Done"
<<
std
::
endl
;
std
::
cerr
<<
"Initialize Threads ..."
;
#endif
PyEval_InitThreads
();
std
::
cerr
<<
"C"
<<
std
::
endl
;
#ifdef PYTHON_DEBUG
std
::
cerr
<<
" Done"
<<
std
::
endl
;
#endif
if
(
!
modulesInitialized
())
{
#ifdef PYTHON_DEBUG
std
::
cerr
<<
"
Import __main__"
;
std
::
cerr
<<
"Import __main__"
;
#endif
//dlopen("libpython3.5m.so.1.0", RTLD_LAZY | RTLD_GLOBAL);
...
...
@@ -124,7 +137,7 @@ void PythonInterpreter::initPython() {
#ifdef PYTHON_DEBUG
std
::
cerr
<<
" Done"
<<
std
::
endl
;
std
::
cerr
<<
"
Redirect Outputs ..."
;
std
::
cerr
<<
"Redirect Outputs ..."
;
#endif
// Redirect python output to integrated logger functions
...
...
@@ -133,7 +146,7 @@ void PythonInterpreter::initPython() {
#ifdef PYTHON_DEBUG
std
::
cerr
<<
" Done"
<<
std
::
endl
;
std
::
cerr
<<
"
Get __dict__ from main namespace ..."
;
std
::
cerr
<<
"Get __dict__ from main namespace ..."
;
#endif
// =========================================================
...
...
@@ -236,12 +249,19 @@ bool PythonInterpreter::runScript(QString _script) {
_script
.
prepend
(
import
);
}
//
init
//
Try to initialize python system
try
{
std
::
cerr
<<
"Run Init Python"
<<
std
::
endl
;
#ifdef PYTHON_DEBUG
std
::
cerr
<<
"Initialize Python"
<<
std
::
endl
;
#endif
initPython
();
std
::
cerr
<<
".. Done"
<<
std
::
endl
;
#ifdef PYTHON_DEBUG
std
::
cerr
<<
"Done initializing Python"
<<
std
::
endl
;
#endif
}
catch
(
py
::
error_already_set
&
e
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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