summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schlüter <github@jan-schlueter.de>2015-06-08 01:06:21 +0200
committerJan Schlüter <github@jan-schlueter.de>2015-06-08 01:21:12 +0200
commit1a82c6d7f8ee97565deefc827735cdc1e3676679 (patch)
tree1012cfc38bafa5280d4b2dad31466b37473c14bf
parent01c59d63ad0356650571e239fffb9e7ee38c4c08 (diff)
downloadnumpy-1a82c6d7f8ee97565deefc827735cdc1e3676679.tar.gz
DOC: Extend github source links to line ranges
-rw-r--r--doc/source/conf.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 13341b56a..3324982c7 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -312,12 +312,12 @@ def linkcode_resolve(domain, info):
return None
try:
- source, lineno = inspect.findsource(obj)
+ source, lineno = inspect.getsourcelines(obj)
except:
lineno = None
if lineno:
- linespec = "#L%d" % (lineno + 1)
+ linespec = "#L%d-L%d" % (lineno, lineno + len(source) - 1)
else:
linespec = ""