Skip to content

Backport PR #11850 on branch v3.0.x #11890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/_macosx.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down