Skip to content

Commit

Permalink
Fix GitHub source code links for decorated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Oct 4, 2024
1 parent 492005e commit 774c307
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ def linkcode_resolve(domain, info):
except AttributeError:
return None

# Unwrap decorators. This requires they used `functools.wrap()`.
while hasattr(obj, "__wrapped__"):
obj = getattr(obj, "__wrapped__")

try:
full_file_name = inspect.getsourcefile(obj)
except TypeError:
Expand Down

0 comments on commit 774c307

Please sign in to comment.