[Python-checkins] CVS: python/dist/src/Mac/Modules/win winsupport.py,1.24,1.25
Jack Jansen
jackjansen@users.sourceforge.net
Wed, 20 Jun 2001 14:20:24 -0700
Update of /cvsroot/python/python/dist/src/Mac/Modules/win
In directory usw-pr-cvs1:/tmp/cvs-serv32519/Python/Mac/Modules/win
Modified Files:
winsupport.py
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: winsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/winsupport.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** winsupport.py 2001/05/22 21:56:42 1.24
--- winsupport.py 2001/06/20 21:20:22 1.25
***************
*** 138,142 ****
OutRbrace()
def outputCheckConvertArg(self):
! Output("#if 1")
OutLbrace()
Output("DialogRef dlg;")
--- 138,145 ----
OutRbrace()
def outputCheckConvertArg(self):
! Out("""
! if (v == Py_None) { *p_itself = NULL; return 1; }
! if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
! """)
OutLbrace()
Output("DialogRef dlg;")
***************
*** 147,160 ****
Output("PyErr_Clear();")
OutRbrace()
- Output("#else")
- OutLbrace("if (DlgObj_Check(v))")
- Output("*p_itself = DlgObj_ConvertToWindow(v);")
- Output("return 1;")
- OutRbrace()
- Output("#endif")
- Out("""
- if (v == Py_None) { *p_itself = NULL; return 1; }
- if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
- """)
def outputCleanupStructMembers(self):
Output("if (self->ob_freeit && self->ob_itself)")
--- 150,153 ----