Barry Warsaw [Wed, 11 Dec 1996 00:15:58 +0000 (00:15 +0000)]
Renamed, and bug fixed:
Two interesting problems in nis_maplist(). First, it is possible that
clnt_create() will return NULL. This was being caught, but no Python
error was being set. I use clnt_spcreateerror() to generate the value
of the exception.
But why would clnt_create() fail? It's because no server was being
found. And why was this? It was because nis_maplist() tried only to
get the NIS master for the first map in the aliases list, which is
passwd.byname, and guess what? That's the one NIS map CNRI does *not*
export! So the yp_master() call was failing to return a valid
server. I now cycle through all the map aliases until I find a valid
master. If not, a different exception is set.
I'm not sure this is the completely correct way to do all this, but
short of rewriting the entire nismodule.c (to expose the proper API to
Python), it should do the trick.
Guido van Rossum [Tue, 10 Dec 1996 23:55:39 +0000 (23:55 +0000)]
Added new quicksort implementation, tailored to sorting arrays of
object pointers. Should be a bit faster than the C library's qsort(),
and doesn't have the prohibition on recursion that Solaris qsort() has
in the threaded version of their C library.
Barry Warsaw [Tue, 10 Dec 1996 19:51:10 +0000 (19:51 +0000)]
New regression testing harness.
(testall.out): obsolete. see individual test output files in the
Output directory.
(testall.py): now contains only the list of all tests
(autotest.py): The new testing harness. Supports -g option to
generate output files instead of verifying; -w option to warn about
non-tested optional modules; additional command line arguments to
generate or test individual tests (useful for generating output file
of new tests).
Guido van Rossum [Tue, 10 Dec 1996 18:07:35 +0000 (18:07 +0000)]
Moved the raise logic out of the main interpreter loop to a separate function.
The raise logic has one additional feature: if you raise <class>,
<value> where <value> is not an instance, it will construct an
instance using <value> as argument. If <value> is None, <class> is
instantiated without arguments. If <value> is a tuple, it is used as
the argument list.
This feature is intended to make it easier to upgrade code from using
string exceptions to using class exceptions; without this feature,
you'd have to change every raise statement from ``raise X'' to ``raise
X()'' and from ``raise X, y'' to ``raise X(y)''. The latter is still
the recommended form (because it has no ambiguities about the number
of arguments), but this change makes the transition less painful.
Barry Warsaw [Tue, 10 Dec 1996 16:28:53 +0000 (16:28 +0000)]
A test of the `new' module. The new.code() test is fairly bogus since
I'm really not sure what the proper inputs are. I do flex the
function call though by passing in arguments of the proper type. I
don't try to exec the code object that gets returned!
Barry Warsaw [Mon, 9 Dec 1996 23:01:30 +0000 (23:01 +0000)]
(python-cc-style): Although open braces for substatements typically
hang on the right side, if they are on a separate line, indent them
under the keyword.
Added #ifdef around ``extern int ftime();'' for MS WINDOWS (which has
a conflicting definition somewhere).
Resolved line wrap for error message in ins().
Barry Warsaw [Fri, 6 Dec 1996 23:30:07 +0000 (23:30 +0000)]
test of time module. not terribly fancy, but it does touch every
function and variable in the module, verifies a few return values and
even tests a couple of known error conditions.
Fred Drake [Fri, 6 Dec 1996 18:45:30 +0000 (18:45 +0000)]
(Makefile): The sed hack is needed for all 3 manuals processed by latex2html;
the comma must represent a bug in the modified process_command()
function, but I haven't found it yet. This will work for now.
Tentative changes to make this work better on 64-bit machines.
A plain int that doesn't fit in 32 bits will be marshalled using a new
type. 32 bits machines can't handle this and will issue a warning.
Fred Drake [Thu, 5 Dec 1996 22:28:43 +0000 (22:28 +0000)]
(libparser.tex): Added note that the line number for a terminal token
indicates the line on which the token ends rather than starts
(a side effect of interpreting the parse tree nodes directly).
Maybe I'll fix this for Python 2.0.
Experimental new implementation of dictionary comparison. This
defines that a shorter dictionary is always smaller than a longer one.
For dictionaries of the same size, the smallest differing element
determines the outcome (which yields the same results as before,
without explicit sorting).