]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
* various modules: #include "Python.h" and remove most remporary
authorGuido van Rossum <guido@python.org>
Wed, 14 Sep 1994 13:32:22 +0000 (13:32 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 14 Sep 1994 13:32:22 +0000 (13:32 +0000)
renaming hacks

Modules/_cursesmodule.c
Modules/_tkinter.c
Modules/rotormodule.c
Modules/signalmodule.c
Modules/stropmodule.c
Modules/termios.c

index 9f0bec9c65121c89484c8c46a07b3328df59b481..fe9787e50a84aa3cc9c51cdf92a69d7f66240b17 100644 (file)
@@ -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;
index 63a3bf96c9f880a3051aace02554b1d903d7a34a..03ed8272928b2db9e700af2c76b9703c0ae40863 100644 (file)
@@ -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>
index da5ed106743e0bb290eeeeb6490860d2a5afaf2e..a7529a3a0c6344f11a1ece3acd82a78dd69235b9 100644 (file)
@@ -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];
index ed441fd5a288ad6c41d793293d5749886d15fb7c..bbb077f9769a361f06f71c6d6637aa1c1f57ebc8 100644 (file)
@@ -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
@@ -103,6 +99,15 @@ PySignal_Handler(sig_num)
                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);
 }
index 68df4dea3d886ff49cde0e28e40ae4732304d1a4..578a771c39094f8c1f3bdb2283af9d65794e3bef 100644 (file)
@@ -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();
index 50661a2f2870b448257f14ff7ea25b23cdddc678..4148d85dc159c6a06dbf8653c9f267b629cbb031 100644 (file)
@@ -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"