Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7dae36

Browse files
committed
Get correct source code link for decorated functions
for sphinx.ext.linkcode
1 parent 70957d8 commit e7dae36

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,8 @@ def linkcode_resolve(domain, info):
604604
except AttributeError:
605605
return None
606606

607+
if inspect.isfunction(obj):
608+
obj = inspect.unwrap(obj)
607609
try:
608610
fn = inspect.getsourcefile(obj)
609611
except TypeError:

0 commit comments

Comments
 (0)