summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-06-22 17:27:32 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2021-06-22 17:55:35 +0200
commita525954b7e1f6bb8237e7d491a9c1d50837eeac7 (patch)
tree82b2ed8a1b63a8e2067f343de70b182e740a39b5 /doc/source
parenta42f9a23a2c7957f20347df4b131c4c9bc2f340d (diff)
downloadnumpy-a525954b7e1f6bb8237e7d491a9c1d50837eeac7.tar.gz
DOC: Do not generate source URLs for re-exported objects
Ignore re-exports as their source files are not within the numpy repo.
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/conf.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index a49074922..59e1e9b8d 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -435,6 +435,11 @@ def linkcode_resolve(domain, info):
if not fn:
return None
+ # Ignore re-exports as their source files are not within the numpy repo
+ module = inspect.getmodule(obj)
+ if module is not None and not module.__name__.startswith("numpy"):
+ return None
+
try:
source, lineno = inspect.getsourcelines(obj)
except Exception: