diff options
| author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-03-23 15:57:20 +0100 |
|---|---|---|
| committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-03-23 15:57:20 +0100 |
| commit | 9f84453ce29952433660704a2ecc5ac8ed53c10e (patch) | |
| tree | 341a19cbe3ab9eee671aa99b1ef0d4c475165a07 /nodes.py | |
| parent | 845d6cc7e3794f92ae65c480285b3a0670d0d1da (diff) | |
| download | astroid-git-9f84453ce29952433660704a2ecc5ac8ed53c10e.tar.gz | |
ExceptHandler should have blockstart_tolineno attribute
Diffstat (limited to 'nodes.py')
| -rw-r--r-- | nodes.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -447,6 +447,17 @@ def try_set_line_info(self, lastchild): TryExcept.set_line_info = try_set_line_info TryFinally.set_line_info = try_set_line_info +def excepthandler_set_line_info(self, lastchild): + self.fromlineno = self.lineno + if self.name: + self.blockstart_tolineno= self.name.tolineno + elif self.type: + self.blockstart_tolineno= self.type.tolineno + else: + self.blockstart_tolineno= self.lineno + self.tolineno = lastchild.tolineno +ExceptHandler.set_line_info = excepthandler_set_line_info + def with_set_line_info(self, lastchild): self.fromlineno = self.blockstart_tolineno = self.lineno self.tolineno = lastchild.tolineno |
