From: Guido van Rossum Date: Mon, 16 Dec 1991 15:44:53 +0000 (+0000) Subject: Change errors into new StdwinError. X-Git-Tag: v0.9.8~684 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbf9434337be08eddc811d962ceddd646ae400df;p=thirdparty%2FPython%2Fcpython.git Change errors into new StdwinError. --- diff --git a/Modules/stdwinmodule.c b/Modules/stdwinmodule.c index 03e2db5add35..299f0acc4cd9 100644 --- a/Modules/stdwinmodule.c +++ b/Modules/stdwinmodule.c @@ -68,7 +68,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "stdwin.h" -#define StdwinError RuntimeError /* XXX Change this later */ +static object *StdwinError; /* Exception stdwin.error */ /* Window and menu object types declared here because of forward references */ @@ -1744,14 +1744,6 @@ window2object(win) w = None; else w = (object *)windowlist[tag]; -#ifdef sgi - /* XXX Trap for unexplained weird bug */ - if ((long)w == (long)0x80000001) { - err_setstr(SystemError, - "bad pointer in stdwin.getevent()"); - return NULL; - } -#endif } INCREF(w); return w; @@ -2201,10 +2193,18 @@ static struct methodlist stdwin_methods[] = { void initstdwin() { - static int inited; + object *m, *d; + static int inited = 0; + if (!inited) { winit(); inited = 1; } - initmodule("stdwin", stdwin_methods); + m = initmodule("stdwin", stdwin_methods); + d = getmoduledict(m); + + /* Initialize stdwin.error exception */ + StdwinError = newstringobject("stdwin.error"); + if (StdwinError == NULL || dictinsert(d, "error", StdwinError) != 0) + fatal("can't define stdwin.error"); }