summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2009-03-04 14:55:33 +0100
committerEmile Anclin <emile.anclin@logilab.fr>2009-03-04 14:55:33 +0100
commitc40da510d63fc1a934901c3cfd988bc4e0946e2a (patch)
tree0d8ed88ba888627faa32395dae88f4eb0ffdf44d
parent00cb0de42b9f99571368294cb796844e9ce52b30 (diff)
downloadastroid-git-c40da510d63fc1a934901c3cfd988bc4e0946e2a.tar.gz
little obvious bugs, cleanup and infos
--HG-- branch : _ast_compat
-rw-r--r--TODO._ast_compat2
-rw-r--r--_nodes_compiler.py11
-rw-r--r--inference.py2
-rw-r--r--lookup.py1
-rw-r--r--scoped_nodes.py2
5 files changed, 3 insertions, 15 deletions
diff --git a/TODO._ast_compat b/TODO._ast_compat
index 598bb2f9..5ad2dac5 100644
--- a/TODO._ast_compat
+++ b/TODO._ast_compat
@@ -10,7 +10,7 @@ Representation
* introduce Delete node for _nodes_compiler
-* handle as_string for Ass/Del
+* handle as_string for Ass/Del; fix decorators_as_string
* introduce arguments nodes (present in _ast) to trash some lambda weirdness
diff --git a/_nodes_compiler.py b/_nodes_compiler.py
index 076b82db..4cecd501 100644
--- a/_nodes_compiler.py
+++ b/_nodes_compiler.py
@@ -119,7 +119,6 @@ class UnaryOp(Node):
from logilab.astng.utils import ASTVisitor
-
class Delete(Node):
"""represent del statements"""
@@ -180,14 +179,10 @@ class TreeRebuilder(ASTVisitor):
def visit_function(self, node):
# remove Stmt node
node.body = node.code.nodes
- node.argnames = node.argnames
- node.defaults = node.defaults
del node.code
def visit_lambda(self, node):
node.body = node.code
- node.argnames = node.argnames
- node.defaults = node.defaults
del node.code
def visit_class(self, node):
@@ -228,9 +223,6 @@ class TreeRebuilder(ASTVisitor):
if node.flags == 'OP_DELETE':
node.__class__ = DelName
del node.flags
-
- def visit_delete(self, node):
- raise "Should be no Delete nodes ; %s " % node
def visit_augassign(self, node):
node.value = node.expr
@@ -274,9 +266,6 @@ class TreeRebuilder(ASTVisitor):
node.items = node.nodes
del node.nodes
- def visit_dict(self, node):
- node.items = node.items
-
def visit_discard(self, node):
node.value = node.expr
del node.expr
diff --git a/inference.py b/inference.py
index c6a57eff..24c37c51 100644
--- a/inference.py
+++ b/inference.py
@@ -718,7 +718,7 @@ nodes.With.assigned_stmts = with_assigned_stmts
nodes.With.ass_type = end_ass_type
nodes.For.ass_type = end_ass_type
-nodes.TryExcept.ass_type = end_ass_type
+nodes.ExceptHandler.ass_type = end_ass_type
nodes.Assign.ass_type = end_ass_type
nodes.Delete.ass_type = end_ass_type
nodes.AugAssign.ass_type = end_ass_type
diff --git a/lookup.py b/lookup.py
index 55b060fd..ab878368 100644
--- a/lookup.py
+++ b/lookup.py
@@ -208,7 +208,6 @@ def _filter_stmts(self, stmts, frame, offset):
if not (optional_assign or are_exclusive(_stmts[pindex], node)):
del _stmt_parents[pindex]
del _stmts[pindex]
- else:
if isinstance(node, nodes.AssName):
if not optional_assign and stmt.parent is mystmt.parent:
_stmts = []
diff --git a/scoped_nodes.py b/scoped_nodes.py
index 1ecebfcf..fc766575 100644
--- a/scoped_nodes.py
+++ b/scoped_nodes.py
@@ -280,7 +280,7 @@ class ModuleNG(object):
# else lookup the astng
#
# We separate the different steps of lookup in try/excepts
- # to avoid catching to many Exceptions
+ # to avoid catching too many Exceptions
# However, we can not analyse dynamically constructed __all__
try:
all = self['__all__']