summaryrefslogtreecommitdiff
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-07-20 22:37:19 +0000
committerBenjamin Peterson <benjamin@python.org>2010-07-20 22:37:19 +0000
commita1047ef59eacea8f3b31386bb6c4a766d6237fd7 (patch)
tree9171cfd297861c7770d7425d570c47618b391093 /Python/symtable.c
parentaa6946d24d85e8dea8d03b70f37d1f11eea49f73 (diff)
downloadcpython-a1047ef59eacea8f3b31386bb6c4a766d6237fd7.tar.gz
move test_trace.py so as not to conflict with future tests for the trace module
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 55c9f472fc..37bdf2a105 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -432,7 +432,14 @@ analyze_name(PySTEntryObject *ste, PyObject *scopes, PyObject *name, long flags,
return PySet_Add(free, name) >= 0;
}
if (flags & DEF_BOUND) {
- SET_SCOPE(scopes, name, LOCAL);
+ if (ste->ste_type == ClassBlock &&
+ !(flags & DEF_PARAM) &&
+ bound && PySet_Contains(bound, name)) {
+ SET_SCOPE(scopes, name, LOCAL_ONLY);
+ }
+ else {
+ SET_SCOPE(scopes, name, LOCAL);
+ }
if (PySet_Add(local, name) < 0)
return 0;
if (PySet_Discard(global, name) < 0)
@@ -489,7 +496,7 @@ analyze_cells(PyObject *scopes, PyObject *free, const char *restricted)
long scope;
assert(PyLong_Check(v));
scope = PyLong_AS_LONG(v);
- if (scope != LOCAL)
+ if (scope != LOCAL && scope != LOCAL_ONLY)
continue;
if (!PySet_Contains(free, name))
continue;