Skip to content

Commit

Permalink
bpo-40477: macOS Python Launcher app fixes for recent macOS releases (p…
Browse files Browse the repository at this point in the history
…ythonGH-30348)

This change solves two problems encountered by users of the macOS Python Launcher app on recent macOS releases (10.14+):

- The launcher app was no longer able to launch the macOS Terminal.app to run a script.

- Even if Terminal.app was already launched, the launcher app was unable to send an Apple Event to Terminal.app to open and run Python with the desired .py file.
  • Loading branch information
ned-deily authored Jan 3, 2022
1 parent fedefa6 commit 549e628
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Mac/PythonLauncher/Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<string>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
Expand Down Expand Up @@ -39,6 +39,8 @@
</array>
<key>CFBundleExecutable</key>
<string>Python Launcher</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2001-2022 Python Software Foundation</string>
<key>CFBundleGetInfoString</key>
<string>%VERSION%, © 2001-2022 Python Software Foundation</string>
<key>CFBundleIconFile</key>
Expand All @@ -61,5 +63,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSAppleEventsUsageDescription</key>
<string>Python Launcher uses Apple events to launch your Python script in a Terminal window.</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Mac/PythonLauncher/doscript.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
AEDesc desc;
OSStatus err;

[[NSWorkspace sharedWorkspace] launchApplication:@"/Applications/Utilities/Terminal.app/"];
[[NSWorkspace sharedWorkspace] launchApplication:@"Terminal.app"];

// Build event
err = AEBuildAppleEvent(kAECoreSuite, kAEDoScript,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The Python Launcher app for macOS now properly launches scripts and, if
necessary, the Terminal app when running on recent macOS releases.

0 comments on commit 549e628

Please sign in to comment.