Guido van Rossum [Fri, 14 Mar 1997 04:23:42 +0000 (04:23 +0000)]
Change PyFPE_END_PROTECT to PyFPE_END_PROTECT(v). v should be the
last variable to which a floating point expression is assigned. The
macro passes its address to a dummy function so that the optimizer
can't delay calculating its value until after the macro.
Guido van Rossum [Tue, 11 Mar 1997 18:42:21 +0000 (18:42 +0000)]
Added support for ``if __debug__:'' -- if -O is given, this form is
recognized by the code generator and code generation for the test and
the subsequent suite is suppressed.
One must write *exactly* ``if __debug__:'' or ``elif __debug__:'' --
no parentheses or operators must be present, or the optimization is
not carried through. Whitespace doesn't matter. Other uses of
__debug__ will find __debug__ defined as 0 or 1 in the __builtin__
module.
Add "extra-verbose" mode, triggered by specifying two -v flags. In
this mode, all tests are run in verbose mode with their output to
stdout. No comparing of output is done.
Much more rigorous testing -- we now try many times, varying in time
of day, day of week, and season.
Fix the weekday predictions -- these seemed to be all bogus. The new
predictions seem to correspond with strftime() on Solaris and IRIX, so
I believe they are correct.
Get rid of the test for non-standard format %C returning "the same as
date(1)". This is hard to do reliably without opening a pipe to date,
and moreover, on IRIX 6.2, %C yields the Century. So we use that
instead. (We don't complain about this in non-verbose mode anyway.)
Jack Jansen [Mon, 24 Feb 1997 13:56:59 +0000 (13:56 +0000)]
- Changed GestaltEqu.h to Gestalt.h
- Changed FragLoader.h to CodeFragments.h
- Removed Desk.h
- Regenerated bgen modules from new universal headers
- Changed some of the s# in PyArg_ParseTuple to m# (unfortunately:
this should have been a different commit)
Jack Jansen [Thu, 20 Feb 1997 15:25:49 +0000 (15:25 +0000)]
- Put USE_MAC_DYNAMIC_LOADING beack here in stead of auto-enabling it
in importdl.c (I had just one crash too many with a static python
importing a dynamic module)
- On powerpc, enable USE_CACHE_ALIGNED with a linesize of 32 bytes.
Guido van Rossum [Tue, 18 Feb 1997 21:53:32 +0000 (21:53 +0000)]
Restructured quite a bit, hopefully Lee Busby will find this useful.
Also grandly renamed.
Here's the new interface:
When WITH_READLINE is defined, two functions are defined:
- PyOS_GnuReadline (what used to be my_readline() with WITH_READLINE)
- PyOS_ReadlineInit (for Dave Ascher)
Always, these functions are defined:
- PyOS_StdioReadline (what used to be my_readline() without WITH_READLINE)
- PyOS_Readline (the interface used by tokenizer.c and [raw_]input().
There's a global function pointer PyOS_ReadlineFunctionPointer,
initialized to NULL. When PyOS_Readline finds this to be NULL, it
sets it to either PyOS_GnuReadline or PyOS_StdioReadline depending on
which one makes more sense (i.e. it uses GNU only if it is defined
*and* stdin is indeed a tty device).
An embedding program that has its own wishes can set the function
pointer to a function of its own design. It should take a char*
prompt argument (which may be NULL) and return a string *ending in a
\n character* -- or "" for EOF or NULL for a user interrupt.
--Guido van Rossum (home page: http://www.python.org/~guido/)
Barry Warsaw [Tue, 18 Feb 1997 18:52:55 +0000 (18:52 +0000)]
Store the current regex syntax along with the regular expression
string as the key to the cache. This means that changing the syntax
will return the correct compiled pattern.
Guido van Rossum [Tue, 18 Feb 1997 16:55:33 +0000 (16:55 +0000)]
Put back #! /usr/local/bin/python. For cgi scripts, /usr/bin/env is
unlikely to find a python binary, as /usr/local/bin is usually not on
the default search path.
Guido van Rossum [Sat, 15 Feb 1997 18:33:24 +0000 (18:33 +0000)]
Require _tkinter -- don't attempt to import tkinter when _tkinter does
not exist. All 8 uses of tkinter are replaced with _tkinter. Still
create a variable tkinter though, because that is used by other
modules importing Tkinter (e.g. tkinter.createfilehandler()).
Also added a comment to the 'import _tkinter' line saying that if this
fails, Python is not configured correctly.
Guido van Rossum [Fri, 14 Feb 1997 19:50:32 +0000 (19:50 +0000)]
My version of Lee Busby's patches to make '-i' pretend stdin is a tty
even if it isn't. Changes:
- set the global flag Py_InteractiveFlag when -i is given
- call Py_FdIsInteractive() instead of isatty()
- make stdin unbuffered, too, when using -u
- make stdin and stdout line buffered, when stdin is interactive and not -u
Note that setting the environment variable PYTHONINSPECT does not have
these extra effects of -i. (Should it?)
Unlike Lee's changes, I don't set change the prompt to go to stderr
when -i is given.
Guido van Rossum [Fri, 14 Feb 1997 19:45:36 +0000 (19:45 +0000)]
Added new global flag variable Py_InteractiveFlag and new function
Py_FdIsInteractive(). The flag is supposed to be set by the -i
command line option. The function is supposed to be called instead of
isatty(). This is used for Lee Busby's wish #1, to have an option
that pretends stdin is interactive even when it really isn't.
Guido van Rossum [Fri, 14 Feb 1997 16:32:14 +0000 (16:32 +0000)]
*Don't* kill all local variables on function exit. This will be done
by the frameobject dealloc when it is time for the locals to go. When
there's still a traceback object referencing this stack frame, we
don't want the local variables to disappear yet.
(Hmm... Shouldn't they be copied to the f_locals dictionary?)
Guido van Rossum [Fri, 14 Feb 1997 16:29:22 +0000 (16:29 +0000)]
Slight tweak: in string_hash(), if the hash hasn't been computed yet,
and if there's a pointer to an interned version of the string, use its
hash and store its hash in this object, rather than recomputing it.