Skip to content

Commit 01cbc36

Browse files
author
Pyrogram-Mod - Dev
committed
fixes for python3.14
1 parent 78b6c29 commit 01cbc36

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

compiler/api/template/type.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ from typing import Union
66
from pyrogram import raw
77

88
{name} = Union[{types}]
9+
_doc = """{docstring}"""
910
try:
10-
{name}.__doc__ = """
11-
{docstring}
12-
"""
11+
_t = type({name})
12+
# 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
1315
except (AttributeError, TypeError):
1416
pass

0 commit comments

Comments
 (0)