]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
* Added Fixcprt.py: script to fix copyright message.
authorGuido van Rossum <guido@python.org>
Tue, 26 Jan 1993 13:33:44 +0000 (13:33 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 26 Jan 1993 13:33:44 +0000 (13:33 +0000)
* various modules: added 1993 to copyright.
* thread.c: added copyright notice.
* ceval.c: minor change to error message for "+"
* stdwinmodule.c: check for error from wfetchcolor
* config.c: MS-DOS fixes (define PYTHONPATH, use DELIM, use osdefs.h)
* Add declaration of inittab to import.h
* sysmodule.c: added sys.builtin_module_names
* xxmodule.c, xxobject.c: fix minor errors

20 files changed:
Include/allobjects.h
Include/import.h
Modules/audioop.c
Modules/config.c.in
Modules/imageop.c
Modules/imgfile.c
Modules/rotormodule.c
Modules/stdwinmodule.c
Modules/svmodule.c
Modules/threadmodule.c
Modules/xxmodule.c
Objects/fileobject.c
Objects/listobject.c
Objects/longobject.c
Objects/xxobject.c
Python/ceval.c
Python/import.c
Python/modsupport.c
Python/sysmodule.c
Python/thread.c

index 34232fd583052bff5bb4822d23f9764149346bfb..d7a03331fc7aaf07b8479e72329ea68617fd8175 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 39f6d9620bb55a586c0e8ed037e67c60d89079e1..c934fe59ae3302a5734ed19a31e9b22778c560d6 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
@@ -29,3 +29,8 @@ object *add_module PROTO((char *name));
 object *import_module PROTO((char *name));
 object *reload_module PROTO((object *m));
 void doneimport PROTO((void));
+
+extern struct {
+       char *name;
+       void (*initfunc)();
+} inittab[];
index c938eea010bb9157a72c6d16f82c3572666d01e0..301b4940077f1b44bf9b931b6b87dc75f0fe8c0f 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 11e2cdd7e16ea635d4704f7e632470fba4e86398..549d14f82ec7a78a81095c73edaed40222895874 100644 (file)
@@ -28,7 +28,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define USE_MARSHAL    1       /* This is linked anyway */
 #define USE_MATH       1
 #define USE_STRUCT     1
-#define USE_STROP      1
 #define USE_TIME       1
 
 #ifdef macintosh
@@ -36,8 +35,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define USE_IMAGEOP    1
 #define USE_MAC                1
 #define USE_REGEX      1
-#define USE_ROTOR      1
 #define USE_STDWIN     1       /* You may turn this off */
+#define USE_STROP
 #endif
 
 #ifdef unix
@@ -48,10 +47,18 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define USE_SOCKET     1
 #endif
 
+#ifdef MSDOS
+#define USE_POSIX      1       /* Subset defined in posixmodule.c */
+#define USE_REGEX      1
+#define USE_STROP      1
+#define USE_PC         1
+#endif
+
 #include <stdio.h>
 
 #include "PROTO.h"
 #include "mymalloc.h"
+#include "osdefs.h"
 
 #include "patchlevel.h"
 
@@ -116,12 +123,25 @@ donecalls()
 }
 
 #ifndef PYTHONPATH
+
 #ifdef macintosh
 /* On the Mac, the search path is a space-separated list of directories */
 #define PYTHONPATH ": :lib :demo"
-#else /* !macintosh */
+#endif /* macintosh */
+
+#ifdef unix
 #define PYTHONPATH ".:/usr/local/lib/python"
-#endif /* !macintosh */
+#endif /* unix */
+
+#ifdef MSDOS
+/* In MS-DOS, the delimiter is a semicolon */
+#define PYTHONPATH ".;C\\python\\lib"
+#endif /* MSDOS */
+
+#ifndef PYTHONPATH
+ERROR; ERROR; On what kind of system are you?;
+#endif
+
 #endif /* !PYTHONPATH */
 
 extern char *getenv();
@@ -135,6 +155,7 @@ getpythonpath()
        char *path = getenv("PYTHONPATH");
        char *defpath = PYTHONPATH;
        char *buf;
+       char *p;
        int n;
 
        if (path == 0 || *path == '\0')
@@ -144,8 +165,9 @@ getpythonpath()
        if (buf == NULL)
                return path; /* XXX too bad -- but not likely */
        strcpy(buf, path);
-       strcat(buf, ":");
-       strcat(buf, defpath);
+       p = buf + strlen(buf);
+       *p++ = DELIM;
+       strcpy(p, defpath);
        return buf;
 #endif /* !macintosh */
 }
index 9c0107b3378c752a9af82a4c4975644b86a34ee7..49301b79832e46bd92305c64ee48b0609afbce47 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 075fc46110518197267dd99064dfb805245f7244..7783083aaf8bc81876566d397fae8d4dde5dd251 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index f16acd03c5f45888a32c2d824ae750bac3e52f69..4e9afd8deb10bcc968326a7d94584e9215a72905 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 62e9b47941bc11389f29f9e40c168ce3da9410da..77ba6ec81d52ce523eb9f96327a813e4630c69a3 100644 (file)
@@ -2119,9 +2119,17 @@ stdwin_fetchcolor(self, args)
        object *args;
 {
        char *colorname;
+       COLOR color;
        if (!getstrarg(args, &colorname))
                return NULL;
-       return newintobject((long)wfetchcolor(colorname));
+       color = wfetchcolor(colorname);
+#ifdef BADCOLOR
+       if (color == BADCOLOR) {
+               err_setstr(StdwinError, "color name not found");
+               return NULL;
+       }
+#endif
+       return newintobject((long)color);
 }
 
 static object *
index 6df8b9504a9fe23a54b7f3073e96e72f37f9afb2..0d144732dbd54ba738cf8ad5c6e502bd8c4eac55 100644 (file)
@@ -1,6 +1,6 @@
 /**********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 123c4d30c888fc8ca35d3c5aa807e91077f1b06b..7a5f29d4f44e150af163142c3fb28631f2dfcb13 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 070a6222cbbf3eb50672420946a6a9a8dc730d43..cf6481efcd246946d5542c267c1aad5b10adb020 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 1c0598bf56618fc486ebe451cf2feacb20da29cd..faf7e861414f67e44f8cbd683ea36689ba24cf3f 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index d7d140f51314b773026e67148ccdeeaaf8e769f0..474932fd1902cdc2a3021f2509c49e9c16487c56 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 85d1c661459620be1924f24fdaa96451153081f3..4c5ede548294e71036c34bb287d33a9d9026b93b 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 8471893e22ab76a3a6cb77c52e25c4b4d77fa7e0..2d03cfddc675846a0148ecfb0c24dc6d922ab52a 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
@@ -80,7 +80,7 @@ xx_demo(self, args)
 }
 
 static struct methodlist xx_methods[] = {
-       "demo",         xx_demo,
+       {"demo",        xx_demo},
        {NULL,          NULL}           /* sentinel */
 };
 
index a46fd362afe8d1d5b14b788ec2bc66a24b6f0e9d..b28f17c6d83e7556605b44de8767c09e32c16556 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
@@ -1577,10 +1577,8 @@ add(v, w)
                DECREF(w);
                return x;
        }
-       else {
-               err_setstr(TypeError, "+ not supported by operands");
-               return NULL;
-       }
+       err_setstr(TypeError, "bad operand type(s) for +");
+       return NULL;
 }
 
 static object *
index 44f6d7bdceb2756a6e5824aca349bb98eaa4dec3..da9422b27d369f660a8f650416e4b9e2e0cb9af3 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
@@ -395,11 +395,6 @@ doneimport()
 
 /* Initialize built-in modules when first imported */
 
-extern struct {
-       char *name;
-       void (*initfunc)();
-} inittab[];
-
 static int
 init_builtin(name)
        char *name;
index 1f281266c9f36d8a703b2d5176407cf7ecfe1b99..f92739aac508b4b88810c6ece86064417d63a390 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
index 5dff38ef793f5281ad59dfa4fb36f9d518801b08..2ad8a266bb6652ff38be7984bf3593afc2b50428 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
 
                         All Rights Reserved
 
@@ -154,6 +154,23 @@ static struct methodlist sys_methods[] = {
 
 static object *sysin, *sysout, *syserr;
 
+static object *
+list_builtin_module_names()
+{
+       object *list = newlistobject(0);
+       int i;
+       if (list == NULL)
+               return NULL;
+       for (i = 0; inittab[i].name != NULL; i++) {
+               object *name = newstringobject(inittab[i].name);
+               if (name == NULL)
+                       break;
+               addlistitem(list, name);
+               DECREF(name);
+       }
+       return list;
+}
+
 void
 initsys()
 {
@@ -175,6 +192,8 @@ initsys()
        dictinsert(sysdict, "stderr", syserr);
        dictinsert(sysdict, "version", v);
        dictinsert(sysdict, "modules", get_modules());
+       dictinsert(sysdict, "builtin_module_names",
+                  list_builtin_module_names());
        if (err_occurred())
                fatal("can't insert sys.* objects in sys dict");
        DECREF(v);
index 44f2896877691d19f14f6ff22efc40eeae8cfd9d..56ef137278b75878c5e84b81a5a0b5627fe7a9b8 100644 (file)
@@ -1,3 +1,27 @@
+/***********************************************************
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the names of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
 #include "thread.h"
 
 #ifdef DEBUG