641 Commits

Author SHA1 Message Date
Guido van Rossum
0c71748e3b Change string version to "2.1.3+". 2003-01-09 06:37:25 +00:00
Jeremy Hylton
f599b7424d Backport fixes for two nested scopes bugs.
frameobject.c: make sure free and cell vars make it into locals, which
    makes eval work.

bltinmodule.c & ceval.c: make sure a code object with free variables
    that is passed to exec or eval raises an exception.

Also duplicate the current trunk test suite in the 2.1 branch, except
for certain necessary changes: different warnings raised by 2.1, need
for __future__.
2002-04-20 18:21:29 +00:00
Anthony Baxter
09d7fc61d4 beginning the dance of the sugar-plum micro-release. 2002-04-08 06:05:51 +00:00
Guido van Rossum
d9ba4cf198 Bump version to 2.1.2 final. 2002-01-15 22:19:12 +00:00
Anthony Baxter
438d26723f tweak version numbers - 2.1.2c1, release candidate. 2002-01-10 16:25:57 +00:00
Anthony Baxter
d7d92afd98 2.1.2 release continues... 2002-01-10 10:00:48 +00:00
Guido van Rossum
9978957937 Add a '+' to the version to indicate this is a post-2.1.1-release CVS
version.
2001-10-19 14:47:47 +00:00
Guido van Rossum
1a39e8ed7c Update the version to the final 2.1.1. 2001-07-18 19:40:14 +00:00
Tim Peters
bfc74e8524 2.1.1c1 WIndows fiddling, plus patchlevel.h. 2001-07-02 04:31:28 +00:00
Thomas Wouters
5829456191 Backport Martin's checkin 2.16:
Wrap with extern "C". Fixes bug #428419.
Also protect against multiple inclusion.
2001-06-27 13:52:56 +00:00
Thomas Wouters
ac4094b31f Backport of Tim's checkin 2.27:
SF patch #418147 Fixes to allow compiling w/ Borland, from Stephen Hansen.
2001-06-27 13:04:24 +00:00
Guido van Rossum
9e0595e295 Set the version number to 2.1.1a1. This checkin inaugurates the
release21-maint branch.
2001-04-17 15:19:29 +00:00
cvs2svn
a839747eb3 This commit was manufactured by cvs2svn to create branch
'release21-maint'.
2001-04-17 15:19:29 +00:00
Guido van Rossum
95f301fa27 Update the version to 2.1final (again :-). 2001-04-16 17:51:43 +00:00
Guido van Rossum
a7a391c580 We need another release candidate after so many "small" changes.
DO NOT CHECK ANYTHHING IN FROM NOW ON WITHOUT ASKING ME.
2001-04-16 00:33:29 +00:00
Guido van Rossum
bfedde832b Prepare for release candidate 1... aka 2.1c1. 2001-04-12 04:11:51 +00:00
Fred Drake
6a1c87ddf9 Add the necessary field for weak reference support to the function and
method types.
2001-03-23 04:17:58 +00:00
Ka-Ping Yee
b5c5132d1a Add sys.excepthook.
Update docstring and library reference section on 'sys' module.
New API PyErr_Display, just for displaying errors, called by excepthook.
Uncaught exceptions now call sys.excepthook; if that fails, we fall back
    to calling PyErr_Display directly.
Also comes with sys.__excepthook__ and sys.__displayhook__.
2001-03-23 02:46:52 +00:00
Fred Drake
4e262a9631 A small change to the C API for weakly-referencable types: Such types
must now initialize the extra field used by the weak-ref machinery to
NULL themselves, to avoid having to require PyObject_INIT() to check
if the type supports weak references and do it there.  This causes less
work to be done for all objects (the type object does not need to be
consulted to check for the Py_TPFLAGS_HAVE_WEAKREFS bit).
2001-03-22 18:26:47 +00:00
Jeremy Hylton
2e2cded1b5 Set the line number correctly for a nested function with an exec or
import *.  Mark the offending stmt rather than the function def line.
2001-03-22 03:57:58 +00:00
Jeremy Hylton
bc32024769 Extend support for from __future__ import nested_scopes
If a module has a future statement enabling nested scopes, they are
also enable for the exec statement and the functions compile() and
execfile() if they occur in the module.

If Python is run with the -i option, which enters interactive mode
after executing a script, and the script it runs enables nested
scopes, they are also enabled in interactive mode.

XXX The use of -i with -c "from __future__ import nested_scopes" is
not supported.  What's the point?

To support these changes, many function variants have been added to
pythonrun.c.  All the variants names end with Flags and they take an
extra PyCompilerFlags * argument.  It is possible that this complexity
will be eliminated in a future version of the interpreter in which
nested scopes are not optional.
2001-03-22 02:47:58 +00:00
Jeremy Hylton
061d106a0f If a code object is compiled with nested scopes, define the CO_NESTED flag.
Add PyEval_GetNestedScopes() which returns a non-zero value if the
code for the current interpreter frame has CO_NESTED defined.
2001-03-22 02:32:48 +00:00
Guido van Rossum
823649d544 Move the code implementing isinstance() and issubclass() to new C
APIs, PyObject_IsInstance() and PyObject_IsSubclass() -- both
returning an int, or -1 for errors.
2001-03-21 18:40:58 +00:00
Guido van Rossum
b845cb0946 Bump version to 2.1b2. 2001-03-20 19:57:10 +00:00
Jeremy Hylton
30c9f3991c Variety of small INC/DECREF patches that fix reported memory leaks
with free variables.  Thanks to Martin v. Loewis for finding two of
the problems.  This fixes SF buf 405583.

There is also a C API change: PyFrame_New() is reverting to its
pre-2.1 signature.  The change introduced by nested scopes was a
mistake.  XXX Is this okay between beta releases?

cell_clear(), the GC helper, must decref its reference to break
cycles.

frame_dealloc() must dealloc all cell vars and free vars in addition
to locals.

eval_code2() setup code must INCREF cells it copies out of the
closure.

The STORE_DEREF opcode implementation must DECREF the object it passes
to PyCell_Set().
2001-03-13 01:58:22 +00:00