@@ -5707,18 +5707,6 @@ - (int)index
5707
5707
return Py_None;
5708
5708
}
5709
5709
5710
- static PyObject*
5711
- verify_main_display (PyObject* self)
5712
- {
5713
- CGDirectDisplayID display = CGMainDisplayID ();
5714
- if (display == 0 ) {
5715
- PyErr_SetString (PyExc_RuntimeError, " Failed to obtain the display ID of the main display" );
5716
- return NULL ;
5717
- }
5718
- Py_INCREF (Py_True);
5719
- return Py_True;
5720
- }
5721
-
5722
5710
typedef struct {
5723
5711
PyObject_HEAD
5724
5712
CFRunLoopTimerRef timer;
@@ -5928,11 +5916,6 @@ static void timer_callback(CFRunLoopTimerRef timer, void* info)
5928
5916
METH_VARARGS,
5929
5917
" Sets the active cursor."
5930
5918
},
5931
- {" verify_main_display" ,
5932
- (PyCFunction)verify_main_display,
5933
- METH_NOARGS,
5934
- " Verifies if the main display can be found. This function fails if Python is not built as a framework."
5935
- },
5936
5919
{NULL , NULL , 0 , NULL }/* sentinel */
5937
5920
};
5938
5921
@@ -5956,8 +5939,10 @@ static void timer_callback(CFRunLoopTimerRef timer, void* info)
5956
5939
5957
5940
void init_macosx (void )
5958
5941
#endif
5959
- { PyObject *module;
5942
+ {
5960
5943
5944
+ #ifdef WITH_NEXT_FRAMEWORK
5945
+ PyObject *module;
5961
5946
import_array ();
5962
5947
5963
5948
if (PyType_Ready (&GraphicsContextType) < 0
@@ -6001,4 +5986,21 @@ void init_macosx(void)
6001
5986
#if PY3K
6002
5987
return module;
6003
5988
#endif
5989
+ #else
5990
+ /* WITH_NEXT_FRAMEWORK is not defined. This means that Python is not
5991
+ * installed as a framework, and therefore the Mac OS X backend will
5992
+ * not interact properly with the window manager.
5993
+ */
5994
+ PyErr_SetString (PyExc_RuntimeError,
5995
+ " Python is not installed as a framework. The Mac OS X backend will "
5996
+ " not be able to function correctly if Python is not installed as a "
5997
+ " framework. See the Python documentation for more information on "
5998
+ " installing Python as a framework on Mac OS X. Please either reinstall "
5999
+ " Python as a framework, or try one of the other backends." );
6000
+ #if PY3K
6001
+ return NULL ;
6002
+ #else
6003
+ return ;
6004
+ #endif
6005
+ #endif
6004
6006
}
0 commit comments