Commit Graph

6202 Commits

Author SHA1 Message Date
Guido van Rossum
dcc0c13f74 Two independent changes (oops):
- Changed semantics for initialized flag (again); forget the ref
counting, forget the fatal errors -- redundant calls to
Py_Initialize() or Py_Finalize() calls are simply ignored.

- Automatically import site.py on initialization, unless a flag is set
not to do this by main().
1997-08-29 22:32:42 +00:00
Guido van Rossum
f30bec7bb2 New site.py semantics. Searches in
<*prefix>/lib/python<version>/packages for *.pth files containing
directories that are appended to sys.path.
1997-08-29 22:30:45 +00:00
Barry Warsaw
83b6709d8e Swap the sense of the -X option vis-a-vis Py_UseClassExceptionsFlag so
that class based exceptions are enabled by default.  -X disables them
in favor of the old-style string exceptions.
1997-08-29 22:20:16 +00:00
Barry Warsaw
757af0e7bb Removed obsolete exception PyExc_AccessError.
Added PyErr_MemoryErrorInst to hold the pre-instantiated instance when
using class based exceptions.

Simplified the creation of all built-in exceptions, both class based
and string based.  Actually, for class based exceptions, the string
ones are still created just in case there's a problem creating the
class based ones (so you still get *some* exception handling!).  Now
the init and fini functions run through a list of structure elements,
creating the strings (and optionally classes) for every entry.

initerrors(): the new base class exceptions StandardError,
LookupError, and NumberError are initialized when using string
exceptions, to tuples containing the list of derived string
exceptions.  This GvR trick enables forward compatibility!  One bit of
nastiness is that the C code has to know the inheritance tree embodied
in exceptions.py.

Added the two phase init and fini functions.
1997-08-29 22:13:51 +00:00
Barry Warsaw
035574d755 Added Py_UseClassExceptionsFlag, the variable containing the state of
the -X command line option.

Py_Initialize(): Handle the two phase initialization of the built-in
module.

Py_Finalize(): Handle the two phase finalization of the built-in
module.

parse_syntax_error(): New function which parses syntax errors that
PyErr_Print() will catch.  This correctly parses such errors
regardless of whether PyExc_SyntaxError is an old-style string
exception or new-fangled class exception.

PyErr_Print(): Many changes:

    1. Normalize the exception.

    2. Handle SystemExit exceptions which might be class based.  Digs
       the exit code out of the "code" attribute.  String based
       SystemExit is handled the same as before.

    3. Handle SyntaxError exceptions which might be class based.  Digs
       the various information bits out of the instance's attributes
       (see parse_syntax_error() for details).  String based
       SyntaxError still works too.

    4. Don't write the `:' after the exception if the exception is
       class based and has an empty string str() value.
1997-08-29 22:07:17 +00:00
Barry Warsaw
d5a0ff972d Added extern definition for -X flag variable. 1997-08-29 22:01:11 +00:00
Barry Warsaw
3e613ce79b New file, which is imported by the built-in module when python is
started with the -X option.  This file contains the definitions for
the built-in exception classes.
1997-08-29 21:59:26 +00:00
Barry Warsaw
6ed41a0a87 Expanded r() function to handle class exceptions. 1997-08-29 21:58:25 +00:00
Barry Warsaw
f488af3360 Parse new command line option -X which enables exception classes. 1997-08-29 21:57:49 +00:00
Barry Warsaw
0596c2ac28 Declarations for two phase initialization and finalization functions
for the built-in module.
1997-08-29 21:57:07 +00:00
Barry Warsaw
392d8272bf Added externs for three new exceptions PyExc_StandardError,
PyExc_NumberError, and PyExc_LookupError.  Also added extern for
pre-instantiated exception instance PyExc_MemoryErrorInst.

Removed extern of obsolete exception PyExc_AccessError.
1997-08-29 21:56:07 +00:00
Barry Warsaw
2d8adff10a PyErr_NoMemory(): If the pre-instantiated memory exception is non-null
(PyExc_MemoryErrorInst) raise this instead of PyExc_MemoryError.  This
only happens when exception classes are enabled (e.g. when Python is
started with -X).
1997-08-29 21:54:35 +00:00
Barry Warsaw
dd82bb9c14 Added a new variable TESTPYTHON which contains the path (and args) for
the executable to use during regression testing.
1997-08-29 21:52:14 +00:00
Guido van Rossum
45140f97a6 Subtle changes to the AIX shared library things to make them work
when building outside the source directory.  Courtesy Donn Cave.
1997-08-29 18:44:06 +00:00
Guido van Rossum
cf0be04b2c Should remove getbuildno.o/buildno files in clobber/distclean targets. 1997-08-29 18:42:35 +00:00
Guido van Rossum
beef8aa719 Cprrect stuoid tyops -- was comparing variabes with themselves because
of co/cp mixup.
1997-08-29 17:12:43 +00:00
Barry Warsaw
eaedc7ce32 eval_code2(), set_exc_info(): Call PyErr_NormalizeException() the
former rather than the latter, since PyErr_NormalizeException takes
PyObject** and I didn't want to change the interface for set_exc_info
(but I did want the changes propagated to eval_code2!).
1997-08-28 22:36:40 +00:00
Guido van Rossum
c1f088201f Added (binaryfunc) casts to function pointers in method lists. 1997-08-28 21:21:22 +00:00
Guido van Rossum
24a49941b3 Some long variables should have been int to match the 'i' format specifier. 1997-08-28 18:11:05 +00:00
Guido van Rossum
02840fdf84 user.py -- when imported, execfile(~/.pythonrc.py). 1997-08-28 14:32:14 +00:00
Guido van Rossum
522578e90f Complete log of changes since 1.5a3 at the end. 1997-08-28 03:43:21 +00:00
Guido van Rossum
a11b041537 Added faqwiz and webchecker. 1997-08-28 02:41:33 +00:00
Guido van Rossum
8c5fa91253 Added section about multiple FAQs. 1997-08-28 02:38:54 +00:00
Guido van Rossum
f1ead1a63c New installation instructions show how to maintain multiple FAQs.
Removed bootstrap script from end of faqwiz.py module.
Added instructions to bootstrap script, too.
Version bumped to 0.8.
Added <html>...</html> feature suggested by Skip Montanaro.
Added leading text for Roulette, default to 'Hit Reload ...'.
Fix typo in default SRCDIR.
1997-08-28 02:38:01 +00:00
Guido van Rossum
8a2d216047 Removed faqmain.py -- it was an earlier implementation and no
longer relevant.
1997-08-27 22:31:18 +00:00
Guido van Rossum
282290f821 Referred to POSIX docs as well as to Unix docs. 1997-08-27 14:54:25 +00:00
Jack Jansen
09dcff793f Put all prints inside "if verbose:" 1997-08-27 14:11:15 +00:00
Jack Jansen
ebacc2edff Removed debug print 1997-08-27 14:10:49 +00:00
Jack Jansen
82bfde9382 Modified for CW Pro projects and new filenames 1997-08-27 14:10:29 +00:00
Jack Jansen
8505ef8c6c Added #include <WETabs.h>, which had somehow gone missing 1997-08-27 14:09:25 +00:00
Jack Jansen
3412c5d0fb Modified for installer and new names of various applets. Also cleaned
up anything else I saw.
1997-08-27 14:08:22 +00:00
Jack Jansen
9ffa432972 Modified for new scripting support 1997-08-27 14:07:37 +00:00
Jack Jansen
21b5d605d8 Moved suites to their own folder 1997-08-27 13:49:18 +00:00
Guido van Rossum
e2ed9df645 Fixed bugs regarding lines starting with '.' (both receiving and sending).
Added a minimal test function.
1997-08-26 23:26:18 +00:00
Guido van Rossum
e20aef574a Ignore whitespace between formats (not internal to a count+format). 1997-08-26 20:39:54 +00:00
Guido van Rossum
ab0abdcef8 Explicitly close the socket and temp file in URLopener.retrieve(), so
that multiple retrievals using the same connection will work.

This leaves open the more general problem that after
    f = urlopen("ftp://...")
f must be closed before another retrieval from the same host should be
attempted.
1997-08-26 19:06:40 +00:00
Barry Warsaw
36b8f945e7 PyErr_Print(): Use PyErr_GivenExceptionMatches() instead of pointer
compares to test for SystemExit and SyntaxError.
1997-08-26 18:09:48 +00:00
Jack Jansen
26726fe523 Replaced by ReadMe 1997-08-26 13:27:22 +00:00
Jack Jansen
83cab722f9 Adapted from ReadMeOrSuffer for the new installer 1997-08-26 13:25:06 +00:00
Jack Jansen
0c96887d35 Handle systemclicks ourselves, in stead of passing them to Sioux. This
fixes (or masks?) a bug with Python becoming unreactive during
time.sleep() if you have already switched applications before.
1997-08-26 13:20:34 +00:00
Guido van Rossum
0cdb887676 Completed first draft. 1997-08-26 00:08:51 +00:00
Barry Warsaw
910105515e unpack_sequence(): In finally clause, watch out for Py_DECREF
evaluating its arguments twice.
1997-08-25 22:30:51 +00:00
Barry Warsaw
09f9547393 regression test for new sequence unpacking semantics 1997-08-25 22:17:45 +00:00
Barry Warsaw
9525df03bf Output for sequence unpacking test 1997-08-25 22:15:22 +00:00
Barry Warsaw
e42b18f9d1 eval_code2(): collapsed the implementations of UNPACK_TUPLE and
UNPACK_LIST byte codes and added a third code path that allows
generalized sequence unpacking.  Now both syntaxes:

    a, b, c = seq
    [a, b, c] = seq

can be used to unpack any sequence with the exact right number of
items.

unpack_sequence(): out-lined implementation of generalized sequence
unpacking.  tuple and list unpacking are still inlined.
1997-08-25 22:13:04 +00:00
Guido van Rossum
1fb071cc64 Checkpoint. 1997-08-25 21:36:44 +00:00
Guido van Rossum
b2173c3146 Allow assignments to instance.__dict__ and instance.__class__. The
former lets you give an instance a set of new instance vars.  The
latter lets you give it a new class.  Both are typechecked and
disallowed in restricted mode.

For classes, the check for read-only special attributes is tightened
so that only assignments to __dict__, __bases__, __name__,
__getattr__, __setattr__, and __delattr__ (these could be made to work
as well, but I don't know if that's useful -- let's see first whether
mucking with instances will help).
1997-08-25 21:23:56 +00:00
Guido van Rossum
a27d112213 Rename roundup() to roundupsize(), as there's a macro roundup() in the
sys/types.h header on many systems that may get pulled in (through
WANT_SIGFPE_HANDLER which pulls in signal.h).
1997-08-25 18:36:23 +00:00
Guido van Rossum
81e479a11f Removed some colons that shouldn't be there (probably leftovers from
docstring conversion).
1997-08-25 18:28:03 +00:00
Guido van Rossum
27e4aa3168 Arbitrary point checkpoint commit. Take no notice. 1997-08-25 15:37:59 +00:00