summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-09-14 13:32:22 (GMT)
committerGuido van Rossum <guido@python.org>1994-09-14 13:32:22 (GMT)
commit602099a7560ab65cd3e0fde9a3defc9e2beb9d87 (patch)
treedfc4b4549b3466e81bccd5ceac4bc25ae926089e /Modules
parenta96720907a040a331f4a75c254a6172daa7273e7 (diff)
downloadcpython-602099a7560ab65cd3e0fde9a3defc9e2beb9d87.zip
cpython-602099a7560ab65cd3e0fde9a3defc9e2beb9d87.tar.gz
cpython-602099a7560ab65cd3e0fde9a3defc9e2beb9d87.tar.bz2
* various modules: #include "Python.h" and remove most remporary
renaming hacks
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_cursesmodule.c6
-rw-r--r--Modules/_tkinter.c30
-rw-r--r--Modules/rotormodule.c7
-rw-r--r--Modules/signalmodule.c15
-rw-r--r--Modules/stropmodule.c12
-rw-r--r--Modules/termios.c17
6 files changed, 20 insertions, 67 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 9f0bec9..fe9787e 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -138,14 +138,10 @@ None notimeout(int) int=0 or int=1
/* 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;
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 63a3bf9..03ed827 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1,35 +1,9 @@
/* 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>
diff --git a/Modules/rotormodule.c b/Modules/rotormodule.c
index da5ed10..a7529a3 100644
--- a/Modules/rotormodule.c
+++ b/Modules/rotormodule.c
@@ -55,16 +55,13 @@ NOTE: you MUST use the SAME key in rotor.newrotor()
/* 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];
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index ed441fd..bbb077f 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -24,16 +24,12 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* 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
@@ -104,6 +100,15 @@ PySignal_Handler(sig_num)
#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);
}
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c
index 68df4de..578a771 100644
--- a/Modules/stropmodule.c
+++ b/Modules/stropmodule.c
@@ -206,10 +206,8 @@ strop_find(self, args)
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();
@@ -242,10 +240,8 @@ strop_rfind(self, args)
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();
diff --git a/Modules/termios.c b/Modules/termios.c
index 50661a2..4148d85 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -1,24 +1,9 @@
/* 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"