/* curses module */
-#include "allobjects.h"
-#include "fileobject.h"
-#include "modsupport.h"
+#include "Python.h"
#include <curses.h>
-#include "rename1.h"
-
typedef struct {
PyObject_HEAD
SCREEN *scr;
/* tkintermodule.c -- Interface to libtk.a and libtcl.a.
Copyright (C) 1994 Steen Lumholt */
-#if 0
-#include <Py/Python.h>
-#else
-
-#include "allobjects.h"
-#include "pythonrun.h"
-#include "intrcheck.h"
-#include "modsupport.h"
-#include "sysmodule.h"
-
-#ifndef PyObject
-#define PyObject object
-typedef struct methodlist PyMethodDef;
-#endif
-#define PyInit_tkinter inittkinter
-
-#undef Py_True
-#define Py_True ((object *) &TrueObject)
-#undef True
-
-#undef Py_False
-#define Py_False ((object *) &FalseObject)
-#undef False
+#include <Python.h>
-#undef Py_None
-#define Py_None (&NoObject)
-#undef None
-
-#endif /* 0 */
+#define PyInit_tkinter inittkinter
#include <tcl.h>
#include <tk.h>
/* Rotor objects */
-#include "allobjects.h"
-#include "modsupport.h"
+#include "Python.h"
+
#include <stdio.h>
#include <math.h>
#define TRUE 1
#define FALSE 0
-/* This is temp until the renaming effort is done with Python */
-#include "rename1.h"
-
typedef struct {
PyObject_HEAD
int seed[3];
/* Signal module -- many thanks to Lance Ellinghouse */
-#include "allobjects.h"
-#include "modsupport.h"
-#include "ceval.h"
+#include "Python.h"
#include "intrcheck.h"
#include <signal.h>
#include <errno.h>
-#include "rename1.h"
-
#ifndef SIG_ERR
#define SIG_ERR ((RETSIGTYPE (*)())-1)
#endif
PySignal_SignalHandlerArray[sig_num].tripped = 1;
#ifdef WITH_THREAD
}
+#endif
+#ifdef SIGCHLD
+ if (sig_num == SIGCHLD) {
+ /* To avoid infinite recursion, this signal remains
+ reset until explicit re-instated.
+ Don't clear the 'func' field as it is our pointer
+ to the Python handler... */
+ return;
+ }
#endif
(void *)signal(sig_num, &PySignal_Handler);
}
if (getargs(args, "(s#s#i)", &s, &len, &sub, &n, &i)) {
if (i < 0)
i += len;
- if (i < 0 || i+n > len) {
- err_setstr(ValueError, "start offset out of range");
- return NULL;
- }
+ if (i < 0)
+ i = 0;
}
else {
err_clear();
if (getargs(args, "(s#s#i)", &s, &len, &sub, &n, &i)) {
if (i < 0)
i += len;
- if (i < 0 || i+n > len) {
- err_setstr(ValueError, "start offset out of range");
- return NULL;
- }
+ if (i < 0)
+ i = 0;
}
else {
err_clear();
/* termiosmodule.c -- POSIX terminal I/O module implementation. */
-#if 0
-#include <Py/Python.h>
-#else
-
-#include "allobjects.h"
-#include "pythonrun.h"
-#include "intrcheck.h"
-#include "modsupport.h"
-#include "sysmodule.h"
-
-#ifndef PyObject
-#define PyObject object
-typedef struct methodlist PyMethodDef;
-#endif
+#include <Python.h>
#define PyInit_termios inittermios
-#endif /* 0 */
-
#include <termios.h>
#define BAD "bad termios argument"