From 2809785e15e15fbb474140567c6f60452cd9a116 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 2 Apr 2005 01:55:41 +0000 Subject: [PATCH] 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 --- wxPython/src/helpers.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 2a568e3e38..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