mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
[3.13] gh-137586: Open external osascript program with absolute path (GH-137584) (#148174)
Co-authored-by: Fionn <1897918+fionn@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4dfcdbe22c
commit
c358b89d24
@@ -350,7 +350,7 @@ class MacOSXOSAScriptTest(unittest.TestCase):
|
||||
url = "https://python.org"
|
||||
self.browser.open(url)
|
||||
self.assertTrue(self.popen_pipe._closed)
|
||||
self.assertEqual(self.popen_pipe.cmd, "osascript")
|
||||
self.assertEqual(self.popen_pipe.cmd, "/usr/bin/osascript")
|
||||
script = self.popen_pipe.pipe.getvalue()
|
||||
self.assertEqual(script.strip(), f'open location "{url}"')
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class DemoWindow(object):
|
||||
# so that our menu bar appears.
|
||||
subprocess.run(
|
||||
[
|
||||
'osascript',
|
||||
'/usr/bin/osascript',
|
||||
'-e', 'tell application "System Events"',
|
||||
'-e', 'set frontmost of the first process whose '
|
||||
'unix id is {} to true'.format(os.getpid()),
|
||||
|
||||
+1
-1
@@ -619,7 +619,7 @@ if sys.platform == 'darwin':
|
||||
end
|
||||
'''
|
||||
|
||||
osapipe = os.popen("osascript", "w")
|
||||
osapipe = os.popen("/usr/bin/osascript", "w")
|
||||
if osapipe is None:
|
||||
return False
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Invoke :program:`osascript` with absolute path in :mod:`webbrowser` and :mod:`!turtledemo`.
|
||||
Reference in New Issue
Block a user