diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-06-20 21:20:22 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-06-20 21:20:22 (GMT) |
commit | 4edc5eb6396fb962ed0827df5ab24cb3b8a7598f (patch) | |
tree | 492f5e0838a21b0ad100432007ce73454150ef59 /Mac/Modules/win/Winmodule.c | |
parent | c65218e1fd084f486b4ce87419e0f18146f2b1a1 (diff) | |
download | cpython-4edc5eb6396fb962ed0827df5ab24cb3b8a7598f.zip cpython-4edc5eb6396fb962ed0827df5ab24cb3b8a7598f.tar.gz cpython-4edc5eb6396fb962ed0827df5ab24cb3b8a7598f.tar.bz2 |
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.
Diffstat (limited to 'Mac/Modules/win/Winmodule.c')
-rw-r--r-- | Mac/Modules/win/Winmodule.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Mac/Modules/win/Winmodule.c b/Mac/Modules/win/Winmodule.c index 639844a..d807251 100644 --- a/Mac/Modules/win/Winmodule.c +++ b/Mac/Modules/win/Winmodule.c @@ -76,7 +76,10 @@ PyObject *WinObj_New(WindowPtr itself) } WinObj_Convert(PyObject *v, WindowPtr *p_itself) { -#if 1 + + if (v == Py_None) { *p_itself = NULL; return 1; } + if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; } + { DialogRef dlg; if (DlgObj_Convert(v, &dlg) && dlg) { @@ -85,16 +88,6 @@ WinObj_Convert(PyObject *v, WindowPtr *p_itself) } 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)) { PyErr_SetString(PyExc_TypeError, "Window required"); |