Skip to content

Commit

Permalink
Fix GitHub source code links for decorated functions (#13281) (#13290)
Browse files Browse the repository at this point in the history
(cherry picked from commit 42ff77b)

Co-authored-by: Eric Arellano <[email protected]>
  • Loading branch information
mergify[bot] and Eric-Arellano authored Oct 7, 2024
1 parent 0f79aa0 commit 7794629
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 7794629

Please sign in to comment.