summaryrefslogtreecommitdiff
path: root/doc/source/conf.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-07-31 12:56:10 -0500
committerGitHub <noreply@github.com>2018-07-31 12:56:10 -0500
commita591b4abca82df4361a34d7e4388335958c42808 (patch)
tree2c6cc631f92c57cd7744a716e2ebc60ab2cf0326 /doc/source/conf.py
parente30cc8e1148523b270fb5884d3743e5968ed3cb1 (diff)
parent0e5864c9ecf8a5691ebf6032ba920126b6103c3e (diff)
downloadnumpy-a591b4abca82df4361a34d7e4388335958c42808.tar.gz
Merge pull request #11644 from eric-wieser/fix-source-links
BUG: Fix doc source links to unwrap decorators
Diffstat (limited to 'doc/source/conf.py')
-rw-r--r--doc/source/conf.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 93a5ea01e..455e9748b 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -321,6 +321,15 @@ def linkcode_resolve(domain, info):
except Exception:
return None
+ # strip decorators, which would resolve to the source of the decorator
+ # possibly an upstream bug in getsourcefile, bpo-1764286
+ try:
+ unwrap = inspect.unwrap
+ except AttributeError:
+ pass
+ else:
+ obj = unwrap(obj)
+
try:
fn = inspect.getsourcefile(obj)
except Exception: