Skip to content

Commit 1866fad

Browse files
committed
simplify to_xml in ws
1 parent 52fa6a0 commit 1866fad

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fasthtml/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ def _wrap_ws(ws, data, params):
263263
# %% ../nbs/api/00_core.ipynb
264264
async def _send_ws(ws, resp):
265265
if not resp: return
266-
res = to_xml(resp, indent=fh_cfg.indent) if isinstance(resp, (list,tuple,FT)) or hasattr(resp, '__ft__') else resp
266+
# res = to_xml(resp, indent=fh_cfg.indent) if isinstance(resp, (list,tuple,FT)) or hasattr(resp, '__ft__') else resp
267+
res = to_xml(resp, indent=fh_cfg.indent)
267268
await ws.send_text(res)
268269

269270
def _ws_endp(recv, conn=None, disconn=None):

nbs/api/00_core.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,8 @@
912912
"#| export\n",
913913
"async def _send_ws(ws, resp):\n",
914914
" if not resp: return\n",
915-
" res = to_xml(resp, indent=fh_cfg.indent) if isinstance(resp, (list,tuple,FT)) or hasattr(resp, '__ft__') else resp\n",
915+
"# res = to_xml(resp, indent=fh_cfg.indent) if isinstance(resp, (list,tuple,FT)) or hasattr(resp, '__ft__') else resp\n",
916+
" res = to_xml(resp, indent=fh_cfg.indent)\n",
916917
" await ws.send_text(res)\n",
917918
"\n",
918919
"def _ws_endp(recv, conn=None, disconn=None):\n",

0 commit comments

Comments
 (0)