Skip to content

Commit ec64fc7

Browse files
committed
Remove dict union operator for 3.8 compatibility
1 parent a054849 commit ec64fc7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

wtforms_bootstrap5/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,20 @@ def __init__(
116116

117117
def form(self, **kwargs) -> RendererContext:
118118
old_options = dataclasses.asdict(self.form_options)
119-
self.form_options = FormOptions(**(old_options | kwargs))
119+
self.form_options = FormOptions(**dict(old_options, **kwargs))
120120
return self
121121

122122
def field(self, *names: str, **kwargs: str) -> RendererContext:
123123
for name in names:
124124
old_options = dataclasses.asdict(
125125
self.field_options.get(name, self.default_field_options)
126126
)
127-
self.field_options[name] = FieldOptions(**(old_options | kwargs))
127+
self.field_options[name] = FieldOptions(**dict(old_options, **kwargs))
128128
return self
129129

130130
def default_field(self, **kwargs: str) -> RendererContext:
131131
self.default_field_options = FieldOptions(
132-
**(dataclasses.asdict(self.default_field_options) | kwargs)
132+
**dict(dataclasses.asdict(self.default_field_options), **kwargs)
133133
)
134134
return self
135135

wtforms_bootstrap5/renderers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def render_form(context: RendererContext, element: FormElement) -> Markup:
6969
content,
7070
enabled=form_options.form_enabled,
7171
class_name=form_options.form_class,
72-
attrs=base_attrs | form_options.form_attrs,
72+
attrs=dict(base_attrs, **form_options.form_attrs),
7373
tag="form",
7474
)
7575

0 commit comments

Comments
 (0)