Skip to content

Commit 285cbb1

Browse files
committed
Check if Python is installed as a framework, and print a warning otherwise.
svn path=/trunk/matplotlib/; revision=8365
1 parent 0f97b8c commit 285cbb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/backends/backend_macosx.py

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import numpy
5+
import MacOS
56

67
from matplotlib._pylab_helpers import Gcf
78
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
@@ -222,6 +223,9 @@ def new_figure_manager(num, *args, **kwargs):
222223
"""
223224
Create a new figure manager instance
224225
"""
226+
if not MacOS.WMAvailable():
227+
import warnings
228+
warnings.warn("Python is not installed as a framework. The MacOSX backend may not work correctly if Python is not installed as a framework. Please see the Python documentation for more information on installing Python as a framework on Mac OS X")
225229
FigureClass = kwargs.pop('FigureClass', Figure)
226230
figure = FigureClass(*args, **kwargs)
227231
canvas = FigureCanvasMac(figure)

0 commit comments

Comments
 (0)