summaryrefslogtreecommitdiffstats
path: root/Modules/stdwinmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-12-16 15:44:53 (GMT)
committerGuido van Rossum <guido@python.org>1991-12-16 15:44:53 (GMT)
commitbbf9434337be08eddc811d962ceddd646ae400df (patch)
tree7d23936f1df0142019a101ef440f96d9a050a90f /Modules/stdwinmodule.c
parent8832b621015c91fcca6799f633aa3f239d6189c1 (diff)
downloadcpython-bbf9434337be08eddc811d962ceddd646ae400df.zip
cpython-bbf9434337be08eddc811d962ceddd646ae400df.tar.gz
cpython-bbf9434337be08eddc811d962ceddd646ae400df.tar.bz2
Change errors into new StdwinError.
Diffstat (limited to 'Modules/stdwinmodule.c')
-rw-r--r--Modules/stdwinmodule.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/Modules/stdwinmodule.c b/Modules/stdwinmodule.c
index 03e2db5..299f0ac 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");
}