There was an error while loading. Please reload this page.
1 parent 78b6c29 commit 01cbc36Copy full SHA for 01cbc36
1 file changed
compiler/api/template/type.txt
@@ -6,9 +6,11 @@ from typing import Union
6
from pyrogram import raw
7
8
{name} = Union[{types}]
9
+_doc = """{docstring}"""
10
try:
- {name}.__doc__ = """
11
- {docstring}
12
- """
+ _t = type({name})
+ # typing.Union (and UnionType) can have a read-only __doc__ on newer Python versions
13
+ if _t.__module__ != "typing" and not (_t.__module__ == "types" and _t.__name__ == "UnionType"):
14
+ {name}.__doc__ = _doc
15
except (AttributeError, TypeError):
16
pass
0 commit comments