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:
Robin Dunn 2005-04-02 01:55:41 +00:00
parent c451eded2c
commit 2809785e15

View File

@ -400,13 +400,17 @@ void wxPyApp::_BootstrapApp()
int argc = 0;
char** argv = NULL;
blocked = wxPyBeginBlockThreads();
PyObject* sysargv = PySys_GetObject("argv");
if (sysargv != NULL) {
argc = PyList_Size(sysargv);
PyObject* executable = PySys_GetObject("executable");
if (sysargv != NULL && executable != NULL) {
argc = PyList_Size(sysargv) + 1;
argv = new char*[argc+1];
argv[0] = PyString_AsString(executable);
int x;
for(x=0; x<argc; x++) {
PyObject *pyArg = PyList_GetItem(sysargv, x);
for(x=1; x<argc; x++) {
PyObject *pyArg = PyList_GetItem(sysargv, x-1);
argv[x] = PyString_AsString(pyArg);
}
argv[argc] = NULL;