From db12e2f4be6e1b310399abc7d8f171b1314487d7 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 19 Aug 2018 15:05:44 -0400 Subject: [PATCH] Backport PR #11850: FIX: macosx framework check --- src/_macosx.m | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/_macosx.m b/src/_macosx.m index 416cf6a583e3..119fc1b8d622 100644 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -2565,24 +2565,12 @@ static void context_cleanup(const void* info) static bool verify_framework(void) { -#ifdef COMPILING_FOR_10_6 - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - NSRunningApplication* app = [NSRunningApplication currentApplication]; - NSApplicationActivationPolicy activationPolicy = [app activationPolicy]; - [pool release]; - switch (activationPolicy) { - case NSApplicationActivationPolicyRegular: - case NSApplicationActivationPolicyAccessory: - return true; - case NSApplicationActivationPolicyProhibited: - break; - } -#else ProcessSerialNumber psn; + /* These methods are deprecated, but they don't require the app to + have started */ if (CGMainDisplayID()!=0 && GetCurrentProcess(&psn)==noErr && SetFrontProcess(&psn)==noErr) return true; -#endif PyErr_SetString(PyExc_ImportError, "Python is not installed as a framework. The Mac OS X backend will " "not be able to function correctly if Python is not installed as a "