From 897f89d47c798053cf3f66c6dd42c1a4a92de67b Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 27 May 2022 11:39:34 -0600 Subject: [PATCH] gui_main.py: fix Privacy prompt --- gui/gui_main.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gui/gui_main.py b/gui/gui_main.py index 6666bf181..618672448 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -1184,14 +1184,18 @@ class wx_python_gui: self.popup.SetYesNoLabels("Open System Preferences", "Ignore") answer = self.popup.ShowModal() if answer == wx.ID_YES: - subprocess.Popen( + output =subprocess.run( [ "osascript", "-e", - 'tell app "System Preferences" to reveal anchor "General" of pane id "com.apple.preference.security"' - ] + 'tell app "System Preferences" to reveal anchor "General" of pane id "com.apple.preference.security"', + "-e", 'tell app "System Preferences" to activate', + ], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE ) - time.sleep(5) - self.OnCloseFrame(None) + if output.returncode == 0: + time.sleep(5) + self.OnCloseFrame(None) else: self.reboot_system(message="Root Patcher finished successfully\nWould you like to reboot now?") self.return_to_main_menu.Enable()