@@ -2955,19 +2955,15 @@ static void _data_provider_release(void* info, const void* data, size_t size)
29552955 CGDataProviderRef provider;
29562956 double rect[4 ] = {0.0 , 0.0 , self->size .width , self->size .height };
29572957
2958- #if PY3K
29592958 if (!PyBytes_Check (image))
29602959 {
2961- PyErr_SetString (PyExc_RuntimeError, " image is not a byte array" );
2962- return NULL ;
2963- }
2960+ #if PY3K
2961+ PyErr_SetString (PyExc_RuntimeError, " image is not a bytes object" );
29642962#else
2965- if (!PyString_Check (image))
2966- {
2967- PyErr_SetString (PyExc_RuntimeError, " image is not a string" );
2963+ PyErr_SetString (PyExc_RuntimeError, " image is not a str object" );
2964+ #endif
29682965 return NULL ;
29692966 }
2970- #endif
29712967
29722968 const size_t bytesPerComponent = 1 ;
29732969 const size_t bitsPerComponent = 8 * bytesPerComponent;
@@ -5096,7 +5092,7 @@ - (void)mouseDown:(NSEvent *)event
50965092 }
50975093 if ([event clickCount ] == 2 ) {
50985094 dblclick = 1 ;
5099- }
5095+ }
51005096 gstate = PyGILState_Ensure ();
51015097 result = PyObject_CallMethod (canvas, " button_press_event" , " iiii" , x, y, num, dblclick);
51025098 if (result)
@@ -5185,7 +5181,7 @@ - (void)rightMouseDown:(NSEvent *)event
51855181 gstate = PyGILState_Ensure ();
51865182 if ([event clickCount ] == 2 ) {
51875183 dblclick = 1 ;
5188- }
5184+ }
51895185 result = PyObject_CallMethod (canvas, " button_press_event" , " iiii" , x, y, num, dblclick);
51905186 if (result)
51915187 Py_DECREF (result);
@@ -5246,7 +5242,7 @@ - (void)otherMouseDown:(NSEvent *)event
52465242 gstate = PyGILState_Ensure ();
52475243 if ([event clickCount ] == 2 ) {
52485244 dblclick = 1 ;
5249- }
5245+ }
52505246 result = PyObject_CallMethod (canvas, " button_press_event" , " iiii" , x, y, num, dblclick);
52515247 if (result)
52525248 Py_DECREF (result);
0 commit comments