summaryrefslogtreecommitdiff
path: root/node_classes.py
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-03-17 11:07:52 +0100
committerEmile Anclin <emile.anclin@logilab.fr>2010-03-17 11:07:52 +0100
commite1bbf73e1b36b5039f86769edbd2faf2988d2b38 (patch)
tree1d4e5ec51b0fda785cdc4e8709ce35d0cb4ee20c /node_classes.py
parent96284deec66ffa4fe59e5a865c02e692ef542bc6 (diff)
downloadastroid-e1bbf73e1b36b5039f86769edbd2faf2988d2b38.tar.gz
some cleanup using pylint
Diffstat (limited to 'node_classes.py')
-rw-r--r--node_classes.py30
1 files changed, 7 insertions, 23 deletions
diff --git a/node_classes.py b/node_classes.py
index 9e38945..7310edb 100644
--- a/node_classes.py
+++ b/node_classes.py
@@ -23,17 +23,16 @@ Module for some node classes. More nodes in scoped_nodes.py
"""
from logilab.common.compat import chain, imap
-from logilab.astng import (ASTNGBuildingException, InferenceError,
- NotFoundError, NoDefault)
+from logilab.astng import NoDefault
from logilab.astng.bases import (NodeNG, BaseClass, Instance, copy_context,
- _infer_stmts)
-from logilab.astng.mixins import (StmtMixIn, BlockRangeMixIn, FilterStmtsMixin,
- AssignTypeMixin, ParentAssignTypeMixin, FromImportMixIn)
+ _infer_stmts, YES)
+from logilab.astng.mixins import (StmtMixIn, BlockRangeMixIn, AssignTypeMixin,
+ ParentAssignTypeMixin, FromImportMixIn)
def unpack_infer(stmt, context=None):
- """return an iterator on nodes inferred by the given statement if the inferred
- value is a list or a tuple, recurse on it to get values inferred by its
- content
+ """return an iterator on nodes inferred by the given statement if the
+ inferred value is a list or a tuple, recurse on it to get values inferred
+ by its content
"""
if isinstance(stmt, (List, Tuple)):
# XXX loosing context
@@ -486,21 +485,6 @@ class EmptyNode(NodeNG):
class ExceptHandler(StmtMixIn, NodeNG, AssignTypeMixin):
"""class representing an ExceptHandler node"""
- def __init__(self):
- # XXX parent.lineno is wrong, can't catch the right line ...
- return # XXX it doesn't work yet
- if exc_type and exc_type.lineno:
- self.fromlineno = exc_type.lineno
- else:
- self.fromlineno = self.body[0].fromlineno - 1
- self.tolineno = self.body[-1].tolineno
- if name:
- self.blockstart_tolineno = name.tolineno
- elif exc_type:
- self.blockstart_tolineno = exc_type.tolineno
- else:
- self.blockstart_tolineno = self.fromlineno
-
def _blockstart_toline(self):
if self.name:
return self.name.tolineno