@@ -294,14 +294,14 @@ static PyObject *WinObj_GetWindowFeatures(_self, _args)
294294 PyObject * _args ;
295295{
296296 PyObject * _res = NULL ;
297- OSStatus _rv ;
297+ OSStatus _err ;
298298 UInt32 outFeatures ;
299299 if (!PyArg_ParseTuple (_args , "" ))
300300 return NULL ;
301- _rv = GetWindowFeatures (_self -> ob_itself ,
302- & outFeatures );
303- _res = Py_BuildValue ( "ll" ,
304- _rv ,
301+ _err = GetWindowFeatures (_self -> ob_itself ,
302+ & outFeatures );
303+ if ( _err != noErr ) return PyMac_Error ( _err );
304+ _res = Py_BuildValue ( "l" ,
305305 outFeatures );
306306 return _res ;
307307}
@@ -311,18 +311,19 @@ static PyObject *WinObj_GetWindowRegion(_self, _args)
311311 PyObject * _args ;
312312{
313313 PyObject * _res = NULL ;
314- OSStatus _rv ;
314+ OSStatus _err ;
315315 WindowRegionCode inRegionCode ;
316316 RgnHandle ioWinRgn ;
317317 if (!PyArg_ParseTuple (_args , "hO&" ,
318318 & inRegionCode ,
319319 ResObj_Convert , & ioWinRgn ))
320320 return NULL ;
321- _rv = GetWindowRegion (_self -> ob_itself ,
322- inRegionCode ,
323- ioWinRgn );
324- _res = Py_BuildValue ("l" ,
325- _rv );
321+ _err = GetWindowRegion (_self -> ob_itself ,
322+ inRegionCode ,
323+ ioWinRgn );
324+ if (_err != noErr ) return PyMac_Error (_err );
325+ Py_INCREF (Py_None );
326+ _res = Py_None ;
326327 return _res ;
327328}
328329
@@ -503,15 +504,16 @@ static PyObject *WinObj_CollapseWindow(_self, _args)
503504 PyObject * _args ;
504505{
505506 PyObject * _res = NULL ;
506- OSStatus _rv ;
507+ OSStatus _err ;
507508 Boolean inCollapseIt ;
508509 if (!PyArg_ParseTuple (_args , "b" ,
509510 & inCollapseIt ))
510511 return NULL ;
511- _rv = CollapseWindow (_self -> ob_itself ,
512- inCollapseIt );
513- _res = Py_BuildValue ("l" ,
514- _rv );
512+ _err = CollapseWindow (_self -> ob_itself ,
513+ inCollapseIt );
514+ if (_err != noErr ) return PyMac_Error (_err );
515+ Py_INCREF (Py_None );
516+ _res = Py_None ;
515517 return _res ;
516518}
517519
@@ -1070,9 +1072,9 @@ static PyMethodDef WinObj_methods[] = {
10701072 {"HiliteWindow" , (PyCFunction )WinObj_HiliteWindow , 1 ,
10711073 "(Boolean fHilite) -> None" },
10721074 {"GetWindowFeatures" , (PyCFunction )WinObj_GetWindowFeatures , 1 ,
1073- "() -> (OSStatus _rv, UInt32 outFeatures)" },
1075+ "() -> (UInt32 outFeatures)" },
10741076 {"GetWindowRegion" , (PyCFunction )WinObj_GetWindowRegion , 1 ,
1075- "(WindowRegionCode inRegionCode, RgnHandle ioWinRgn) -> (OSStatus _rv) " },
1077+ "(WindowRegionCode inRegionCode, RgnHandle ioWinRgn) -> None " },
10761078 {"SetWRefCon" , (PyCFunction )WinObj_SetWRefCon , 1 ,
10771079 "(long data) -> None" },
10781080 {"GetWRefCon" , (PyCFunction )WinObj_GetWRefCon , 1 ,
@@ -1098,7 +1100,7 @@ static PyMethodDef WinObj_methods[] = {
10981100 {"IsWindowCollapsed" , (PyCFunction )WinObj_IsWindowCollapsed , 1 ,
10991101 "() -> (Boolean _rv)" },
11001102 {"CollapseWindow" , (PyCFunction )WinObj_CollapseWindow , 1 ,
1101- "(Boolean inCollapseIt) -> (OSStatus _rv) " },
1103+ "(Boolean inCollapseIt) -> None " },
11021104 {"MacMoveWindow" , (PyCFunction )WinObj_MacMoveWindow , 1 ,
11031105 "(short hGlobal, short vGlobal, Boolean front) -> None" },
11041106 {"SizeWindow" , (PyCFunction )WinObj_SizeWindow , 1 ,
@@ -1475,14 +1477,15 @@ static PyObject *Win_CollapseAllWindows(_self, _args)
14751477 PyObject * _args ;
14761478{
14771479 PyObject * _res = NULL ;
1478- OSStatus _rv ;
1480+ OSStatus _err ;
14791481 Boolean inCollapseEm ;
14801482 if (!PyArg_ParseTuple (_args , "b" ,
14811483 & inCollapseEm ))
14821484 return NULL ;
1483- _rv = CollapseAllWindows (inCollapseEm );
1484- _res = Py_BuildValue ("l" ,
1485- _rv );
1485+ _err = CollapseAllWindows (inCollapseEm );
1486+ if (_err != noErr ) return PyMac_Error (_err );
1487+ Py_INCREF (Py_None );
1488+ _res = Py_None ;
14861489 return _res ;
14871490}
14881491
@@ -1584,7 +1587,7 @@ static PyMethodDef Win_methods[] = {
15841587 {"ValidRgn" , (PyCFunction )Win_ValidRgn , 1 ,
15851588 "(RgnHandle goodRgn) -> None" },
15861589 {"CollapseAllWindows" , (PyCFunction )Win_CollapseAllWindows , 1 ,
1587- "(Boolean inCollapseEm) -> (OSStatus _rv) " },
1590+ "(Boolean inCollapseEm) -> None " },
15881591 {"PinRect" , (PyCFunction )Win_PinRect , 1 ,
15891592 "(Rect theRect, Point thePt) -> (long _rv)" },
15901593 {"GetGrayRgn" , (PyCFunction )Win_GetGrayRgn , 1 ,
0 commit comments