| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
| |
The problem was introduced by r53954, the correction is to restore the symmetry between
PyFrame_FastToLocals and PyFrame_LocalsToFast
|
| |
|
|
|
|
| |
the pointer
is still present in the containing structure.
|
| |
|
|
|
|
|
|
|
| |
Fixes bug 1569356, but at the cost of a minor incompatibility in
locals(). Add test that verifies that the class namespace is not
polluted. Also clarify the behavior in the library docs.
Along the way, cleaned up the dict_to_map and map_to_dict
implementations and added some comments that explain what they do.
|
| | |
|
| |
|
|
|
| |
I tried to enclose all tests which must be run at the toplevel
(instead of inside a method) in exec statements.
|
| | |
|
| |
|
|
|
| |
historically been looked up using LOAD_NAME, not LOAD_GLOBAL.
looked up by LOAD_NAME, not
|
| |
|
|
|
|
|
|
|
|
| |
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.
The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
|
| |
|
|
|
|
|
|
|
|
|
| |
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".
This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).
Now Tim and Jack can have at it. :)
|
| |
|
|
| |
Related to SF bug #505315
|
| |
|
|
| |
when no arguments are passed
|
| |
|
|
| |
instead.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Add test that calls eval with a code object that has free variables.
|
| | |
|
| |
|
|
| |
Two errors in dict_to_map() helper used by PyFrame_LocalsToFast().
|
| |
|
|
|
|
|
|
| |
The new test case demonstrates the bug. Be more careful in
symtable_resolve_free() to add a var to cells or frees only if it
won't be added under some other rule.
XXX Add new assertion that will catch this bug.
|
| |
|
|
|
|
|
|
|
| |
now raises NameError instead of UnboundLocalError, because the var in
question is definitely not local. (This affects test_scope.py)
Also update the recent fix by Ping using get_func_name(). Replace
tests of get_func_name() return value with call to get_func_desc() to
match all the other uses.
|
| |
|
|
|
| |
- global stmt in class does not affect free vars in methods
- locals() works with free and cell vars
|
| | |
|
| |
|
|
| |
cause the free variables to leak.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compile.h: #define NESTED_SCOPES_DEFAULT 0 for Python 2.1
__future__ feature name: "nested_scopes"
symtable.h: Add st_nested_scopes slot. Define flags to track exec and
import star.
Lib/test/test_scope.py: requires nested scopes
compile.c: Fiddle with error messages.
Reverse the sense of ste_optimized flag on
PySymtableEntryObjects. If it is true, there is an optimization
conflict.
Modify get_ref_type to respect st_nested_scopes flags.
Refactor symtable_load_symbols() into several smaller functions,
which use struct symbol_info to share variables. In new function
symtable_update_flags(), raise an error or warning for import * or
bare exec that conflicts with nested scopes. Also, modify handle
for free variables to respect st_nested_scopes flag.
In symtable_init() assign st_nested_scopes flag to
NESTED_SCOPES_DEFAULT (defined in compile.h).
Add preliminary and often incorrect implementation of
symtable_check_future().
Add symtable_lookup() helper for future use.
|
| |
|
|
| |
Move check_syntax() function into test_support.
|
| | |
|
| |
|
|
| |
functinos and cell vars with */** parameters
|
| | |
|
| |
|
|
| |
Add tests for unbound locals (Nick Mathewson)
|
| |
|
|
| |
recently fixed bug, but it checked for the wrong answer.
|
|
|
New tests cases for nested scopes.
|