summaryrefslogtreecommitdiff
path: root/Mac/OSX/pythonw.c
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2006-10-08 17:41:25 +0000
committerRonald Oussoren <ronaldoussoren@mac.com>2006-10-08 17:41:25 +0000
commit392cafba4fb899f8a205f7962302b77db8c61980 (patch)
tree74ec202946b517aac1a4bbcccdd1eac9b6223f8b /Mac/OSX/pythonw.c
parent16ca35a2a59712400b1326166f26a689b646e6bb (diff)
downloadcpython-git-392cafba4fb899f8a205f7962302b77db8c61980.tar.gz
Port of universal binary support for Mac OSX from python 2.5. This takes away
the need for the out-of-tree universal binary support that was used to build the 2.4.3 installer. Missing here relative to that tree are some changes to IDLE, IMHO those patches aren't appropriate for the 2.4 branch and users are better of using 2.5's IDLE.
Diffstat (limited to 'Mac/OSX/pythonw.c')
-rw-r--r--Mac/OSX/pythonw.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Mac/OSX/pythonw.c b/Mac/OSX/pythonw.c
new file mode 100644
index 0000000000..e70a76f846
--- /dev/null
+++ b/Mac/OSX/pythonw.c
@@ -0,0 +1,17 @@
+/*
+ * This wrapper program executes a python executable hidden inside an
+ * application bundle inside the Python framework. This is needed to run
+ * GUI code: some GUI API's don't work unless the program is inside an
+ * application bundle.
+ */
+#include <unistd.h>
+#include <err.h>
+
+static char Python[] = PYTHONWEXECUTABLE;
+
+int main(int argc, char **argv) {
+ argv[0] = Python;
+ execv(Python, argv);
+ err(1, "execv: %s", Python);
+ /* NOTREACHED */
+}