summary refs log tree commit diff
path: root/synapse/media
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/media')
-rw-r--r--synapse/media/oembed.py5
-rw-r--r--synapse/media/preview_html.py3
2 files changed, 3 insertions, 5 deletions
diff --git a/synapse/media/oembed.py b/synapse/media/oembed.py
index 94ece30459..16d613d271 100644
--- a/synapse/media/oembed.py
+++ b/synapse/media/oembed.py
@@ -256,12 +256,11 @@ def calc_description_and_urls(open_graph_response: JsonDict, html_body: str) ->
     parser = etree.HTMLParser(recover=True, encoding="utf-8")
 
     # Attempt to parse the body. If this fails, log and return no metadata.
-    # TODO Develop of lxml-stubs has this correct.
-    tree = etree.fromstring(html_body, parser)  # type: ignore[arg-type]
+    tree = etree.fromstring(html_body, parser)
 
     # The data was successfully parsed, but no tree was found.
     if tree is None:
-        return  # type: ignore[unreachable]
+        return
 
     # Attempt to find interesting URLs (images, videos, embeds).
     if "og:image" not in open_graph_response:
diff --git a/synapse/media/preview_html.py b/synapse/media/preview_html.py
index 8a2c098d53..62ce7789be 100644
--- a/synapse/media/preview_html.py
+++ b/synapse/media/preview_html.py
@@ -160,8 +160,7 @@ def decode_body(
 
     # Attempt to parse the body. Returns None if the body was successfully
     # parsed, but no tree was found.
-    # TODO Develop of lxml-stubs has this correct.
-    return etree.fromstring(body, parser)  # type: ignore[arg-type]
+    return etree.fromstring(body, parser)
 
 
 def _get_meta_tags(