summaryrefslogtreecommitdiff
path: root/scoped_nodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'scoped_nodes.py')
-rw-r--r--scoped_nodes.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/scoped_nodes.py b/scoped_nodes.py
index a8f9bdc8..68053fc7 100644
--- a/scoped_nodes.py
+++ b/scoped_nodes.py
@@ -339,6 +339,9 @@ class FunctionNG(object):
def set_line_info(self, lastchild):
self.fromlineno = self.lineno
+ # lineno is the line number of the first decorator, we want the def statement lineno
+ if self.decorators is not None:
+ self.fromlineno += len(self.decorators.nodes)
self.tolineno = lastchild.tolineno
self.blockstart_tolineno = self.args.tolineno