Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FIX: don't import macosx to check if eventloop running#12603

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 2 commits intomatplotlib:masterfromjklymak:fix-dont-import-macosx
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes fromall 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
8 changes: 2 additions & 6 deletionslib/matplotlib/backends/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,12 +47,8 @@ def _get_running_interactive_framework():
if frame.f_code == tkinter.mainloop.__code__:
return "tk"
frame = frame.f_back
try:
from matplotlib.backends import _macosx
except ImportError:
pass
else:
if _macosx.event_loop_is_running():
if 'matplotlib.backends._macosx' in sys.modules:
if sys.modules["matplotlib.backends._macosx"].event_loop_is_running():
return "macosx"
if sys.platform.startswith("linux") and not os.environ.get("DISPLAY"):
return "headless"
Expand Down
12 changes: 12 additions & 0 deletionssrc/_macosx.m
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2580,9 +2580,21 @@ static bool verify_framework(void)
ProcessSerialNumber psn;
/* These methods are deprecated, but they don't require the app to
have started */
#ifdef COMPILING_FOR_10_6
NSApp = [NSApplication sharedApplication];
NSApplicationActivationPolicy activationPolicy = [NSApp activationPolicy];
switch (activationPolicy) {
case NSApplicationActivationPolicyRegular:
case NSApplicationActivationPolicyAccessory:
return true;
case NSApplicationActivationPolicyProhibited:
break;
}
#else
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

[8]ページ先頭

©2009-2025 Movatter.jp