Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f14f241

Browse files
committed
FIX: don't import macosx to check if eventloop running
1 parent 87aa310 commit f14f241

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/matplotlib/backends/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ def _get_running_interactive_framework():
4747
if frame.f_code == tkinter.mainloop.__code__:
4848
return "tk"
4949
frame = frame.f_back
50-
try:
51-
from matplotlib.backends import _macosx
52-
except ImportError:
53-
pass
54-
else:
55-
if _macosx.event_loop_is_running():
50+
if ('_macosx' in sys.modules) and (_macosx.event_loop_is_running()):
5651
return "macosx"
5752
if sys.platform.startswith("linux") and not os.environ.get("DISPLAY"):
5853
return "headless"

0 commit comments

Comments
 (0)