X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6e6b35578d9be94739e1f9ebadcb57d9a483db6a..c437fde9f90fc7dfcac79053d214fc9146d7be21:/wxPython/src/helpers.cpp?ds=sidebyside diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 9b7e3efb6d..b5ad3f8f6b 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -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