[Python-checkins] CVS: python/dist/src/Mac/Modules/win Winmodule.c,1.35,1.36
Jack Jansen
jackjansen@users.sourceforge.net
Wed, 20 Jun 2001 14:20:20 -0700
Update of /cvsroot/python/python/dist/src/Mac/Modules/win
In directory usw-pr-cvs1:/tmp/cvs-serv32463/Python/Mac/Modules/win
Modified Files:
Winmodule.c
Log Message:
Reversed the order of the checks for None or a Dialog where a Window is expected so it doesn't crash under OSX/Mach-o.
Index: Winmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/Winmodule.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** Winmodule.c 2001/05/22 21:56:36 1.35
--- Winmodule.c 2001/06/20 21:20:18 1.36
***************
*** 77,81 ****
WinObj_Convert(PyObject *v, WindowPtr *p_itself)
{
! #if 1
{
DialogRef dlg;
--- 77,84 ----
WinObj_Convert(PyObject *v, WindowPtr *p_itself)
{
!
! if (v == Py_None) { *p_itself = NULL; return 1; }
! if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
!
{
DialogRef dlg;
***************
*** 86,99 ****
PyErr_Clear();
}
- #else
- if (DlgObj_Check(v)) {
- *p_itself = DlgObj_ConvertToWindow(v);
- return 1;
- }
- #endif
-
- if (v == Py_None) { *p_itself = NULL; return 1; }
- if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
-
if (!WinObj_Check(v))
{
--- 89,92 ----