Skip to content

Commit 25b9f81

Browse files
committed
fixup! fix unexpected '__doc__' values
1 parent f83d1cd commit 25b9f81

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

astroid/nodes/node_classes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,11 +2062,12 @@ def __init__(
20622062
source code. Note: This is after the last symbol.
20632063
"""
20642064
if getattr(value, "__name__", None) == "__doc__":
2065-
raise AssertionError( # pragma: no cover
2065+
warnings.warn( # pragma: no cover
20662066
"You have most likely called a __doc__ field of some object "
20672067
"and it didn't return a string. "
20682068
"That happens to some symbols from the standard library. "
2069-
"Check for isinstance(<X>.__doc__, str)."
2069+
"Check for isinstance(<X>.__doc__, str).",
2070+
RuntimeWarning,
20702071
)
20712072
self.value = value
20722073
"""The value that the constant represents."""

0 commit comments

Comments
 (0)