mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Support Python 3.9
Remove the '|' syntax for type unions, since it's a 3.10 feature, and set mypy to check with version 3.9.
This commit is contained in:
parent
d6c6a66c15
commit
0b8012b8e1
7 changed files with 18 additions and 11 deletions
|
@ -1,3 +1,5 @@
|
|||
import typing as T
|
||||
|
||||
from .. import OutputFormat
|
||||
from ...language import *
|
||||
from .xml_emitter import XmlEmitter
|
||||
|
@ -45,7 +47,7 @@ class XmlOutput(OutputFormat):
|
|||
self._emit_object_or_template(obj, xml)
|
||||
xml.end_tag()
|
||||
|
||||
def _emit_object_or_template(self, obj: Object | Template, xml: XmlEmitter):
|
||||
def _emit_object_or_template(self, obj: T.Union[Object, Template], xml: XmlEmitter):
|
||||
for child in obj.content.children:
|
||||
if isinstance(child, Property):
|
||||
self._emit_property(child, xml)
|
||||
|
@ -123,7 +125,7 @@ class XmlOutput(OutputFormat):
|
|||
|
||||
def _translated_string_attrs(
|
||||
self, translated: TranslatedStringValue
|
||||
) -> T.Dict[str, str | None]:
|
||||
) -> T.Dict[str, T.Optional[str]]:
|
||||
return {
|
||||
"translatable": "true",
|
||||
"context": translated.context,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue