1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

Add compatibility with Python < 3.10 in weechat.pyi

The | syntax for unions is only supported in Python 3.10 and later.
Since Python 3.8 and 3.9 are still supported upstream for a while and we
had a user reporting on IRC that they couldn't use the stub file since
they are using 3.8, change to the old syntax for unions to support this.

There aren't really any drawbacks of this. It's just a bit more verbose,
and a typing import is necessary, but neither of those really matters in
a generated stub file.
This commit is contained in:
Trygve Aaberge
2023-08-24 18:36:05 +02:00
committed by Sébastien Helleu
parent 3a59f2f65e
commit d14e74ccf6
7 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ STUB_HEADER = """\
# DO NOT EDIT BY HAND!
#
from typing import Dict
from typing import Dict, Union
"""
CONSTANT_RE = (