Skip to content

Commit 42a5cfc

Browse files
authored
Fix inconsistent imports of markupsafe (pelme#131)
In pelme#119, all markupsafe imports were updated to simply `import markupsafe`. This change was not applied to pelme#113 before it was merged.
1 parent 8299cbc commit 42a5cfc

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

htpy/_with_children.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import functools
44
import typing as t
55

6-
from markupsafe import Markup as _Markup
6+
import markupsafe
77

88
if t.TYPE_CHECKING:
99
from collections.abc import Callable, Iterator, Mapping
@@ -73,12 +73,12 @@ def __getitem__(self, children: C | None) -> R:
7373
#
7474
return self.wrapped(children) # type: ignore[call-arg]
7575

76-
def __str__(self) -> _Markup:
76+
def __str__(self) -> markupsafe.Markup:
7777
# This is the unbound component being rendered to a string:
7878
#
7979
# str(my_component)
8080
#
81-
return _Markup(self.wrapped(None)) # type: ignore[call-arg]
81+
return markupsafe.Markup(self.wrapped(None)) # type: ignore[call-arg]
8282

8383
__html__ = __str__
8484

@@ -120,12 +120,12 @@ def __getitem__(self, children: C | None) -> R:
120120
#
121121
return self._func(children, *self._args, **self._kwargs)
122122

123-
def __str__(self) -> _Markup:
123+
def __str__(self) -> markupsafe.Markup:
124124
# This is a bound component being rendered to a string:
125125
#
126126
# str(my_component(title="My title"))
127127
#
128-
return _Markup(self._func(None, *self._args, **self._kwargs))
128+
return markupsafe.Markup(self._func(None, *self._args, **self._kwargs))
129129

130130
__html__ = __str__
131131

0 commit comments

Comments
 (0)