mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +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:
committed by
Sébastien Helleu
parent
48d33521dc
commit
a82bfa0e7e
+1
-1
@@ -37,7 +37,7 @@ STUB_HEADER = """\
|
||||
# DO NOT EDIT BY HAND!
|
||||
#
|
||||
|
||||
from typing import Dict
|
||||
from typing import Dict, Union
|
||||
"""
|
||||
|
||||
CONSTANT_RE = (
|
||||
|
||||
Reference in New Issue
Block a user