Put the Python executable pathname in wxTheApp->argv[0] so the
stackwalker won't freak out at trying to find program addresses inside of .py files! git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -400,13 +400,17 @@ void wxPyApp::_BootstrapApp()
|
|||||||
int argc = 0;
|
int argc = 0;
|
||||||
char** argv = NULL;
|
char** argv = NULL;
|
||||||
blocked = wxPyBeginBlockThreads();
|
blocked = wxPyBeginBlockThreads();
|
||||||
|
|
||||||
PyObject* sysargv = PySys_GetObject("argv");
|
PyObject* sysargv = PySys_GetObject("argv");
|
||||||
if (sysargv != NULL) {
|
PyObject* executable = PySys_GetObject("executable");
|
||||||
argc = PyList_Size(sysargv);
|
|
||||||
|
if (sysargv != NULL && executable != NULL) {
|
||||||
|
argc = PyList_Size(sysargv) + 1;
|
||||||
argv = new char*[argc+1];
|
argv = new char*[argc+1];
|
||||||
|
argv[0] = PyString_AsString(executable);
|
||||||
int x;
|
int x;
|
||||||
for(x=0; x<argc; x++) {
|
for(x=1; x<argc; x++) {
|
||||||
PyObject *pyArg = PyList_GetItem(sysargv, x);
|
PyObject *pyArg = PyList_GetItem(sysargv, x-1);
|
||||||
argv[x] = PyString_AsString(pyArg);
|
argv[x] = PyString_AsString(pyArg);
|
||||||
}
|
}
|
||||||
argv[argc] = NULL;
|
argv[argc] = NULL;
|
||||||
|
Reference in New Issue
Block a user