Skip to content

Commit

Permalink
fixup! fix unexpected '__doc__' values
Browse files Browse the repository at this point in the history
  • Loading branch information
temyurchenko committed Sep 10, 2024
1 parent f83d1cd commit 25b9f81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions astroid/nodes/node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2062,11 +2062,12 @@ def __init__(
source code. Note: This is after the last symbol.
"""
if getattr(value, "__name__", None) == "__doc__":
raise AssertionError( # pragma: no cover
warnings.warn( # pragma: no cover
"You have most likely called a __doc__ field of some object "
"and it didn't return a string. "
"That happens to some symbols from the standard library. "
"Check for isinstance(<X>.__doc__, str)."
"Check for isinstance(<X>.__doc__, str).",
RuntimeWarning,
)
self.value = value
"""The value that the constant represents."""
Expand Down

0 comments on commit 25b9f81

Please sign in to comment.