]> git.saurik.com Git - wxWidgets.git/commitdiff
Put the Python executable pathname in wxTheApp->argv[0] so the
authorRobin Dunn <robin@alldunn.com>
Sat, 2 Apr 2005 01:55:41 +0000 (01:55 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 2 Apr 2005 01:55:41 +0000 (01:55 +0000)
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

index 2a568e3e3852305a91f7237e371de02c15f6473a..b5ad3f8f6b8a241c84b5ba0a24e78f4923fd6e20 100644 (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;