{
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
signal(SIGINT, intcatcher);
+#ifdef SV_INTERRUPT
+ /* This is for SunOS and other modern BSD derivatives.
+ It means that system calls (like read()) are not restarted
+ after an interrupt. This is necessary so interrupting a
+ read() or readline() call works as expected.
+ XXX On old BSD (pure 4.2 or older) you may have to do this
+ differently! */
+ siginterrupt(SIGINT, 1);
+#endif
}
int
#include "traceback.h"
/* Turn this on if your compiler chokes on the big switch: */
-/* #define CASE_TOO_BIG 1 /**/
+/* #define CASE_TOO_BIG 1 /**/
-#ifndef NDEBUG
+/* Turn this on if you want to debug the interpreter: */
+/* (This can be on even if NDEBUG is defined) */
+/* #define DEBUG 1 /**/
+
+#if defined(DEBUG) || !defined(NDEBUG)
/* For debugging the interpreter: */
#define LLTRACE 1 /* Low-level trace feature */
#define CHECKEXC 1 /* Double-check exception checking */
#endif
-#define DEBUG
-
/* Forward declarations */
char *name; /* Name used by some instructions */
int needmerge = 0;
#ifdef LLTRACE
- int lltrace = dictlookup(globals, "__lltrace__") != NULL;
+ int lltrace;
#endif
#ifdef DEBUG
/* Make it easier to find out where we are with dbx */
locals = globals;
}
+#ifdef LLTRACE
+ lltrace = dictlookup(globals, "__lltrace__") != NULL;
+#endif
+
f = newframeobject(
current_frame, /*back*/
co, /*code*/
{
/* Merge f->f_locals into f->f_fastlocals */
object *locals, *fast, *map;
+ object *error_type, *error_value;
int i;
if (f == NULL)
return;
if (!is_dictobject(locals) || !is_listobject(fast) ||
!is_dictobject(map))
return;
+ err_get(&error_type, &error_value);
i = getdictsize(map);
while (--i >= 0) {
object *key;
if (setlistitem(fast, j, value) != 0)
err_clear();
}
+ err_setval(error_type, error_value);
}
void