Change errors into new StdwinError.

This commit is contained in:
Guido van Rossum 1991-12-16 15:44:53 +00:00
parent 8832b62101
commit bbf9434337

View File

@ -68,7 +68,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "stdwin.h" #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 */ /* Window and menu object types declared here because of forward references */
@ -1744,14 +1744,6 @@ window2object(win)
w = None; w = None;
else else
w = (object *)windowlist[tag]; 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); INCREF(w);
return w; return w;
@ -2201,10 +2193,18 @@ static struct methodlist stdwin_methods[] = {
void void
initstdwin() initstdwin()
{ {
static int inited; object *m, *d;
static int inited = 0;
if (!inited) { if (!inited) {
winit(); winit();
inited = 1; 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");
} }