@@ -5707,18 +5707,6 @@ - (int)index
57075707 return Py_None;
57085708}
57095709
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-
57225710typedef struct {
57235711 PyObject_HEAD
57245712 CFRunLoopTimerRef timer;
@@ -5928,11 +5916,6 @@ static void timer_callback(CFRunLoopTimerRef timer, void* info)
59285916 METH_VARARGS,
59295917 " Sets the active cursor."
59305918 },
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- },
59365919 {NULL , NULL , 0 , NULL }/* sentinel */
59375920};
59385921
@@ -5956,8 +5939,10 @@ static void timer_callback(CFRunLoopTimerRef timer, void* info)
59565939
59575940void init_macosx (void )
59585941#endif
5959- { PyObject *module;
5942+ {
59605943
5944+ #ifdef WITH_NEXT_FRAMEWORK
5945+ PyObject *module;
59615946 import_array ();
59625947
59635948 if (PyType_Ready (&GraphicsContextType) < 0
@@ -6001,4 +5986,21 @@ void init_macosx(void)
60015986#if PY3K
60025987 return module;
60035988#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
60046006}
0 commit comments