Skip to content

Commit 24ab22f

Browse files
vkk800jreback
authored andcommitted
DOC: Fix creation of [source] links in the doc creation (#23129)
1 parent 6db8d19 commit 24ab22f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/source/conf.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,11 @@ def linkcode_resolve(domain, info):
569569
return None
570570

571571
try:
572-
fn = inspect.getsourcefile(obj)
572+
# inspect.unwrap() was added in Python version 3.4
573+
if sys.version_info >= (3, 5):
574+
fn = inspect.getsourcefile(inspect.unwrap(obj))
575+
else:
576+
fn = inspect.getsourcefile(obj)
573577
except:
574578
fn = None
575579
if not fn:

0 commit comments

Comments
 (0)