Skip to content

Commit

Permalink
fix: AttributeError in subclass docstring logic (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Sep 6, 2024
1 parent b76c1cb commit d37f1a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions a_sync/iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def __init_subclass__(cls, **kwargs) -> None:

# format the member docstrings
for attr_name in dir(cls):
attr = getattr(cls, attr_name)
if attr.__doc__ and "{cls}" in attr.__doc__:
attr = getattr(cls, attr_name, None)
if attr is not None and attr.__doc__ and "{cls}" in attr.__doc__:
attr.__doc__ = attr.__doc__.replace("{cls}", f":class:`{cls.__name__}`")

return super().__init_subclass__(**kwargs)
Expand Down

0 comments on commit d37f1a0

Please sign in to comment.